build: lint the npm folder (#26085)

This commit is contained in:
David Sanders 2020-10-21 15:43:52 -07:00 committed by GitHub
parent 22cb3cd18b
commit 2aa5a1f494
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 51 deletions

View file

@ -1,18 +1,18 @@
var fs = require('fs')
var path = require('path')
const fs = require('fs');
const path = require('path');
var pathFile = path.join(__dirname, 'path.txt')
const pathFile = path.join(__dirname, 'path.txt');
function getElectronPath () {
if (fs.existsSync(pathFile)) {
var executablePath = fs.readFileSync(pathFile, 'utf-8')
const executablePath = fs.readFileSync(pathFile, 'utf-8');
if (process.env.ELECTRON_OVERRIDE_DIST_PATH) {
return path.join(process.env.ELECTRON_OVERRIDE_DIST_PATH, executablePath)
return path.join(process.env.ELECTRON_OVERRIDE_DIST_PATH, executablePath);
}
return path.join(__dirname, 'dist', executablePath)
return path.join(__dirname, 'dist', executablePath);
} else {
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again');
}
}
module.exports = getElectronPath()
module.exports = getElectronPath();