This commit is contained in:
Kevin Sawicki 2016-12-27 11:48:14 -08:00
Родитель 835c64b7b2
Коммит ed8260e4d9
1 изменённых файлов: 21 добавлений и 21 удалений

Просмотреть файл

@ -16,27 +16,7 @@ try {
// do nothing
}
var platform = process.env.npm_config_platform || os.platform()
function onerror (err) {
throw err
}
function getPath (platform) {
switch (platform) {
case 'darwin':
return 'dist/Electron.app/Contents/MacOS/Electron'
case 'freebsd':
case 'linux':
return 'dist/electron'
case 'win32':
return 'dist/electron.exe'
default:
throw new Error('Electron builds are not available on platform: ' + platform)
}
}
var platformPath = getPath(platform)
var platformPath = getPlatformPath()
if (installedVersion === version && fs.existsSync(path.join(__dirname, platformPath))) {
process.exit(0)
@ -61,3 +41,23 @@ function extractFile (err, zipPath) {
})
})
}
function onerror (err) {
throw err
}
function getPlatformPath () {
var platform = process.env.npm_config_platform || os.platform()
switch (platform) {
case 'darwin':
return 'dist/Electron.app/Contents/MacOS/Electron'
case 'freebsd':
case 'linux':
return 'dist/electron'
case 'win32':
return 'dist/electron.exe'
default:
throw new Error('Electron builds are not available on platform: ' + platform)
}
}