Fail gracefully when chromium failed to download (#430)

Fail gracefully when chromium failed to download

This patch changes both install.js and Launcher.js to inform how
chromium could be downloaded manually.
This commit is contained in:
Andrey Lushnikov
2017-08-21 13:34:10 -07:00
committed by GitHub
parent 598f439a32
commit c1731dd5d7
4 changed files with 20 additions and 9 deletions

View File

@@ -129,13 +129,11 @@ module.exports = {
/**
* @param {string} platform
* @param {string} revision
* @return {?{executablePath: string}}
* @return {!{folderPath: string, executablePath: string, downloaded: boolean, url: string}}
*/
revisionInfo: function(platform, revision) {
console.assert(downloadURLs[platform], `Unsupported platform: ${platform}`);
let folderPath = getFolderPath(platform, revision);
if (!fs.existsSync(folderPath))
return null;
let executablePath = '';
if (platform === 'mac')
executablePath = path.join(folderPath, 'chrome-mac', 'Chromium.app', 'Contents', 'MacOS', 'Chromium');
@@ -146,7 +144,10 @@ module.exports = {
else
throw 'Unsupported platfrom: ' + platfrom;
return {
executablePath: executablePath
executablePath,
folderPath,
downloaded: fs.existsSync(folderPath),
url: util.format(downloadURLs[platform], revision)
};
},
};