MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / unzip

Function unzip

src/test/common.node.ts:155–173  ·  view source on GitHub ↗
(zipFile: string, targetFolder: string)

Source from the content-addressed store, hash-verified

153}
154
155export async function unzip(zipFile: string, targetFolder: string): Promise<void> {
156 await fs.ensureDir(targetFolder);
157 return new Promise<void>((resolve, reject) => {
158 const zip = new StreamZip({
159 file: zipFile,
160 storeEntries: true
161 });
162 zip.on('ready', async () => {
163 zip.extract('extension', targetFolder, (err: any) => {
164 if (err) {
165 reject(err);
166 } else {
167 resolve();
168 }
169 zip.close();
170 });
171 });
172 });
173}
174
175export async function openFile(file: string): Promise<TextDocument> {
176 const textDocument = await vscode.workspace.openTextDocument(file);

Callers 1

Calls 3

onMethod · 0.65
closeMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected