Use require to load package.json instead of fs/JSON

This commit is contained in:
Kevin Sawicki 2016-07-05 15:50:12 -07:00
parent 83ae14f2ed
commit b8e5180132

View file

@ -119,7 +119,7 @@ for (i = 0, len = searchPaths.length; i < len; i++) {
packagePath = searchPaths[i]
try {
packagePath = path.join(process.resourcesPath, packagePath)
packageJson = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json')))
packageJson = require(path.join(packagePath, 'package.json'))
break
} catch (error) {
continue