Merge pull request #80 from yoz/install-dirname-movable
Don't save __dirname into path.txt.
This commit is contained in:
commit
49fa2314ae
2 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue