diff --git a/bin/index.js b/bin/index.js index 3dd8e01..7c81737 100644 --- a/bin/index.js +++ b/bin/index.js @@ -5,4 +5,6 @@ const path = require('path') const NPM_PATH = path.join(__dirname, 'node_modules', '.bin', 'npm') -npx(npx.parseArgs(process.argv, NPM_PATH)) +const parsed = npx.parseArgs(process.argv, NPM_PATH) +parsed.npxPkg = path.join(__dirname, 'package.json') +npx(parsed) diff --git a/index.js b/index.js index 9e89772..d6ef5e5 100755 --- a/index.js +++ b/index.js @@ -64,7 +64,9 @@ function npx (argv) { } if ((!existing && !argv.call) || argv.packageRequested) { // We only fire off the updateNotifier if we're installing things - require('update-notifier')({pkg: require('./package.json')}).notify() + if (argv.npxPkg) { + require('update-notifier')({pkg: require(argv.npxPkg)}).notify() + } // Some npm packages need to be installed. Let's install them! return ensurePackages(argv.package, argv).then(results => { if (results && results.added && results.updated && !argv.q) {