mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Output path as chromium gets successfully downloaded (#689)
Fixes #679.
This commit is contained in:
parent
51a507b236
commit
e12ce802cd
17
install.js
17
install.js
@ -31,12 +31,25 @@ if (revisionInfo.downloaded)
|
||||
|
||||
const allRevisions = Downloader.downloadedRevisions();
|
||||
Downloader.downloadRevision(platform, revision, onProgress)
|
||||
// Remove previous chromium revisions.
|
||||
.then(() => Promise.all(allRevisions.map(({platform, revision}) => Downloader.removeRevision(platform, revision))))
|
||||
.then(onSuccess)
|
||||
.catch(onError);
|
||||
|
||||
/**
|
||||
* @return {!Promise}
|
||||
*/
|
||||
function onSuccess() {
|
||||
console.log('Chromium downloaded to ' + revisionInfo.folderPath);
|
||||
// Remove previous chromium revisions.
|
||||
const cleanupOldVersions = allRevisions.map(({platform, revision}) => Downloader.removeRevision(platform, revision));
|
||||
return Promise.all(cleanupOldVersions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {!Error} error
|
||||
*/
|
||||
function onError(error) {
|
||||
console.error(`ERROR: Failed to download Chromium r${revision}! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.`);
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user