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

Commit

Permalink
feat(perf): only launch update-notifier when npx installs stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Jun 20, 2017
1 parent 00fc313 commit 549d413
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
const child = require('./child')
const parseArgs = require('./parse-args.js')
const path = require('path')
const pkg = require('./package.json')
const updateNotifier = require('update-notifier')
const which = promisify(require('which'))

const PATH_SEP = process.platform === 'win32' ? ';' : ':'

updateNotifier({pkg}).notify()
main(parseArgs())

module.exports = main
Expand Down Expand Up @@ -64,6 +61,8 @@ function main (argv) {
process.env = newEnv
}
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()
// Some npm packages need to be installed. Let's install them!
return ensurePackages(argv.package, argv).then(results => {
console.error(Y()`npx: installed ${
Expand Down

0 comments on commit 549d413

Please sign in to comment.