Update index.js
This commit is contained in:
parent
39caff88c9
commit
5c8ebb296c
1 changed files with 7 additions and 1 deletions
|
@ -1,4 +1,10 @@
|
||||||
var fs = require('fs')
|
var fs = require('fs')
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
|
|
||||||
module.exports = path.join(__dirname, fs.readFileSync(path.join(__dirname, 'path.txt'), 'utf-8'))
|
const pathFile = path.join(__dirname, 'path.txt')
|
||||||
|
|
||||||
|
if (fs.existsSync(pathFile)) {
|
||||||
|
module.exports = path.join(__dirname, fs.readFileSync(pathFile, 'utf-8'))
|
||||||
|
} else {
|
||||||
|
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again');
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue