Merge pull request #6354 from electron/package-json-bom
Use require to load package.json
This commit is contained in:
commit
6fe4653b54
1 changed files with 1 additions and 1 deletions
|
@ -119,7 +119,7 @@ for (i = 0, len = searchPaths.length; i < len; i++) {
|
||||||
packagePath = searchPaths[i]
|
packagePath = searchPaths[i]
|
||||||
try {
|
try {
|
||||||
packagePath = path.join(process.resourcesPath, packagePath)
|
packagePath = path.join(process.resourcesPath, packagePath)
|
||||||
packageJson = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json')))
|
packageJson = require(path.join(packagePath, 'package.json'))
|
||||||
break
|
break
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue