From 949dc7b514db017e3a439d9d4c8e00bff2e26b27 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Tue, 7 Apr 2020 14:56:30 -0700 Subject: [PATCH] chore: bump extract-zip dependency (#1696) Fixes #1510 --- package.json | 2 +- src/server/browserFetcher.ts | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 498d846c7d..b8cb8ec994 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "license": "Apache-2.0", "dependencies": { "debug": "^4.1.0", - "extract-zip": "^1.6.6", + "extract-zip": "^2.0.0", "https-proxy-agent": "^3.0.0", "jpeg-js": "^0.3.6", "mime": "^2.4.4", diff --git a/src/server/browserFetcher.ts b/src/server/browserFetcher.ts index 37dbe38ab8..ee927bbefe 100644 --- a/src/server/browserFetcher.ts +++ b/src/server/browserFetcher.ts @@ -145,7 +145,7 @@ export async function downloadBrowser(options: DownloadOptions): Promise { const zipPath = path.join(os.tmpdir(), `playwright-download-${browser}-${platform}-${revision}.zip`); try { await downloadFile(url, zipPath, progress); - await extractZip(zipPath, downloadPath); + await extract(zipPath, {dir: downloadPath}); } finally { if (await existsAsync(zipPath)) await unlinkAsync(zipPath); @@ -211,15 +211,6 @@ function downloadFile(url: string, destinationPath: string, progressCallback: On } } -function extractZip(zipPath: string, folderPath: string): Promise { - return new Promise((fulfill, reject) => extract(zipPath, {dir: folderPath}, err => { - if (err) - reject(err); - else - fulfill(); - })); -} - function httpRequest(url: string, method: string, response: (r: any) => void) { let options: any = URL.parse(url); options.method = method;