Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Commit

Permalink
fix(updater): dependency injection for update-notifier target
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Jul 11, 2017
1 parent c864cb7 commit c3027a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c3027a9

Please sign in to comment.