diff --git a/bin/now.js b/bin/now.js index f88f3d7..dde5842 100755 --- a/bin/now.js +++ b/bin/now.js @@ -26,7 +26,7 @@ try { // Utilities const pkg = require('../lib/pkg') -if (pkg._npmPkg) { +if (!process.pkg) { const notifier = updateNotifier({ pkg }) const update = notifier.update diff --git a/lib/pkg.js b/lib/pkg.js index 51ff78d..094f5eb 100644 --- a/lib/pkg.js +++ b/lib/pkg.js @@ -1,13 +1,10 @@ /* eslint-disable import/no-unresolved */ -const path = require('path') -const pkg = require('../package.json') - +let pkg try { - const distDir = path.dirname(process.execPath) - pkg._npmPkg = require(path.join(distDir, '../../package.json')) + pkg = require('../package.json') } catch (err) { - pkg._npmPkg = null + pkg = require('../../package.json') } module.exports = pkg