Merge pull request #6295 from atom/ks-require-package-dot-json

Use require to read/parse package.json
This commit is contained in:
Kevin Sawicki 2015-04-07 16:09:59 -07:00
commit e39e25a92e

View File

@ -276,8 +276,7 @@ class PackageManager
getPackageDependencies: ->
unless @packageDependencies?
try
metadataPath = path.join(@resourcePath, 'package.json')
{@packageDependencies} = JSON.parse(fs.readFileSync(metadataPath)) ? {}
@packageDependencies = require('../package.json')?.packageDependencies
@packageDependencies ?= {}
@packageDependencies