Update index.js

This commit is contained in:
Samuel Attard 2016-12-27 12:17:48 +13:00 committed by Kevin Sawicki
parent 39caff88c9
commit 5c8ebb296c

View file

@ -1,4 +1,10 @@
var fs = require('fs')
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');
}