build: lint the npm folder (#26085)
This commit is contained in:
parent
22cb3cd18b
commit
2aa5a1f494
4 changed files with 51 additions and 51 deletions
16
npm/index.js
16
npm/index.js
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue