Merge pull request #6376 from electron/require-package-json-in-default-app

Use require to load package.json in default app
This commit is contained in:
Cheng Zhao 2016-07-07 10:25:56 +09:00 committed by GitHub
commit a053dc2f7d

View file

@ -229,7 +229,7 @@ function loadApplicationPackage (packagePath) {
if (fs.existsSync(packageJsonPath)) {
let packageJson
try {
packageJson = JSON.parse(fs.readFileSync(packageJsonPath))
packageJson = require(packageJsonPath)
} catch (e) {
showErrorMessage(`Unable to parse ${packageJsonPath}\n\n${e.message}`)
return