Skip to content

Commit 949dc7b

Browse files
authored
chore: bump extract-zip dependency (#1696)
Fixes #1510
1 parent c6f580f commit 949dc7b

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"license": "Apache-2.0",
4545
"dependencies": {
4646
"debug": "^4.1.0",
47-
"extract-zip": "^1.6.6",
47+
"extract-zip": "^2.0.0",
4848
"https-proxy-agent": "^3.0.0",
4949
"jpeg-js": "^0.3.6",
5050
"mime": "^2.4.4",

src/server/browserFetcher.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export async function downloadBrowser(options: DownloadOptions): Promise<void> {
145145
const zipPath = path.join(os.tmpdir(), `playwright-download-${browser}-${platform}-${revision}.zip`);
146146
try {
147147
await downloadFile(url, zipPath, progress);
148-
await extractZip(zipPath, downloadPath);
148+
await extract(zipPath, {dir: downloadPath});
149149
} finally {
150150
if (await existsAsync(zipPath))
151151
await unlinkAsync(zipPath);
@@ -211,15 +211,6 @@ function downloadFile(url: string, destinationPath: string, progressCallback: On
211211
}
212212
}
213213

214-
function extractZip(zipPath: string, folderPath: string): Promise<Error | null> {
215-
return new Promise((fulfill, reject) => extract(zipPath, {dir: folderPath}, err => {
216-
if (err)
217-
reject(err);
218-
else
219-
fulfill();
220-
}));
221-
}
222-
223214
function httpRequest(url: string, method: string, response: (r: any) => void) {
224215
let options: any = URL.parse(url);
225216
options.method = method;

0 commit comments

Comments
 (0)