MCPcopy
hub / github.com/anomalyco/opencode / writeZip

Function writeZip

packages/desktop/src/main/logging.ts:181–189  ·  view source on GitHub ↗
(output: string, entries: Entry[])

Source from the content-addressed store, hash-verified

179}
180
181async function writeZip(output: string, entries: Entry[]) {
182 const writer = new ZipWriter(new BlobWriter("application/zip"))
183 for (const entry of entries) {
184 const data = entry.data ?? readFileSync(entry.path!)
185 await writer.add(entry.name, new BlobReader(new Blob([new Uint8Array(data)])))
186 }
187 const zip = await writer.close()
188 writeFileSync(output, Buffer.from(await zip.arrayBuffer()))
189}
190
191function initConsoleTransport() {
192 const write = log.transports.console.writeFn.bind(log.transports.console)

Callers 1

exportDebugLogsFunction · 0.85

Calls 4

addMethod · 0.65
arrayBufferMethod · 0.65
closeMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected