Skip to content

Commit 9a394a4

Browse files
committed
just raise error
1 parent 280ce0d commit 9a394a4

1 file changed

Lines changed: 14 additions & 20 deletions

File tree

scripts/download-wda-sim.mjs

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,24 @@ async function prepareRootDir() {
4444
}
4545

4646
async function getWDAPrebuiltPackage() {
47+
const destDir = await prepareRootDir();
48+
const platform = parseArgValue('platform');
49+
const zipFileName = destZip(platform);
50+
const wdaVersion = await webdriveragentPkgVersion();
51+
const urlToDownload = wdaUrl(wdaVersion, zipFileName);
52+
const downloadedZipFile = path.join(destDir, zipFileName);
4753
try {
48-
const destDir = await prepareRootDir();
49-
const platform = parseArgValue('platform');
50-
const zipFileName = destZip(platform);
51-
const wdaVersion = await webdriveragentPkgVersion();
52-
const urlToDownload = wdaUrl(wdaVersion, zipFileName);
53-
const downloadedZipFile = path.join(destDir, zipFileName);
54-
try {
55-
log.info(`Downloading ${urlToDownload}`);
56-
await net.downloadFile(urlToDownload, downloadedZipFile);
54+
log.info(`Downloading ${urlToDownload}`);
55+
await net.downloadFile(urlToDownload, downloadedZipFile);
5756

58-
log.info(`Unpacking ${downloadedZipFile} into ${destDir}`);
59-
await zip.extractAllTo(downloadedZipFile, destDir);
57+
log.info(`Unpacking ${downloadedZipFile} into ${destDir}`);
58+
await zip.extractAllTo(downloadedZipFile, destDir);
6059

61-
log.info(`Deleting ${downloadedZipFile}`);
62-
} finally {
63-
if (await fs.exists(downloadedZipFile)) {
64-
await fs.unlink(downloadedZipFile);
65-
}
60+
log.info(`Deleting ${downloadedZipFile}`);
61+
} finally {
62+
if (await fs.exists(downloadedZipFile)) {
63+
await fs.unlink(downloadedZipFile);
6664
}
67-
process.exit(0);
68-
} catch (err) {
69-
log.error(err.message || err);
70-
process.exit(1);
7165
}
7266
}
7367

0 commit comments

Comments
 (0)