зеркало из https://github.com/electron/electron.git
Don't save __dirname into path.txt.
Allows install to work even if our directory is moved later.
This commit is contained in:
Родитель
b152f6d215
Коммит
999a998469
|
@ -1,4 +1,4 @@
|
||||||
var fs = require('fs')
|
var fs = require('fs')
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
|
|
||||||
module.exports = fs.readFileSync(path.join(__dirname, 'path.txt'), 'utf-8')
|
module.exports = path.join(__dirname, fs.readFileSync(path.join(__dirname, 'path.txt'), 'utf-8'))
|
||||||
|
|
|
@ -23,14 +23,14 @@ function onerror (err) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var paths = {
|
var paths = {
|
||||||
darwin: path.join(__dirname, './dist/Electron.app/Contents/MacOS/Electron'),
|
darwin: 'dist/Electron.app/Contents/MacOS/Electron',
|
||||||
linux: path.join(__dirname, './dist/electron'),
|
linux: 'dist/electron',
|
||||||
win32: path.join(__dirname, './dist/electron.exe')
|
win32: 'dist/electron.exe'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!paths[platform]) throw new Error('Unknown platform: ' + platform)
|
if (!paths[platform]) throw new Error('Unknown platform: ' + platform)
|
||||||
|
|
||||||
if (installedVersion === version && fs.existsSync(paths[platform])) {
|
if (installedVersion === version && fs.existsSync(path.join(__dirname, paths[platform]))) {
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче