Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
return false;
}

const zipPath = path.join(os.tmpdir(), downloadFileName);
const downloadFolder = await fs.promises.mkdtemp(path.join(os.tmpdir(), 'playwright-download-'));
const zipPath = path.join(downloadFolder, downloadFileName);
try {
const retryCount = 5;
for (let attempt = 1; attempt <= retryCount; ++attempt) {
Expand All @@ -49,8 +50,9 @@
debugLogger.log('install', `SUCCESS installing ${title}`);
break;
}
if (await existsAsync(zipPath))
if (await existsAsync(zipPath)) {

Check failure on line 53 in packages/playwright-core/src/server/registry/browserFetcher.ts

View workflow job for this annotation

GitHub Actions / docs & lint

Unnecessary { after 'if' condition
await fs.promises.unlink(zipPath);
}
if (await existsAsync(browserDirectory))
await fs.promises.rmdir(browserDirectory, { recursive: true });
const errorMessage = error?.message || '';
Expand All @@ -65,6 +67,7 @@
} finally {
if (await existsAsync(zipPath))
await fs.promises.unlink(zipPath);
await fs.promises.rmdir(downloadFolder, { recursive: true });

Check failure on line 70 in packages/playwright-core/src/server/registry/browserFetcher.ts

View workflow job for this annotation

GitHub Actions / docs & lint

Expected indentation of 4 spaces but found 6
}
logPolitely(`${title} downloaded to ${browserDirectory}`);
return true;
Expand Down
Loading