Skip to content

Commit

Permalink
Output path as chromium gets successfully downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov committed Sep 5, 2017
1 parent 2817130 commit b7b2172
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion install.js
Expand Up @@ -32,11 +32,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()
.then(onSuccess)
.catch(onError);

/**
* @return {!Promise}
*/
function onSuccess() {
console.log('Chromium downloaded to ' + revisionInfo.folderPath);
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);
}

Expand Down

0 comments on commit b7b2172

Please sign in to comment.