From 0e6de2c31dbf8c21277481f112e99c52b913940f Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 27 Dec 2017 19:33:54 +0100 Subject: node_modules --- node_modules/update-notifier/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'node_modules/update-notifier/index.js') diff --git a/node_modules/update-notifier/index.js b/node_modules/update-notifier/index.js index a5fff0103..58f245903 100644 --- a/node_modules/update-notifier/index.js +++ b/node_modules/update-notifier/index.js @@ -9,6 +9,7 @@ const chalk = importLazy('chalk'); const semverDiff = importLazy('semver-diff'); const latestVersion = importLazy('latest-version'); const isNpm = importLazy('is-npm'); +const isInstalledGlobally = importLazy('is-installed-globally'); const boxen = importLazy('boxen'); const xdgBasedir = importLazy('xdg-basedir'); const ONE_DAY = 1000 * 60 * 60 * 24; @@ -109,7 +110,7 @@ class UpdateNotifier { return this; } - opts = Object.assign({isGlobal: true}, opts); + opts = Object.assign({isGlobal: isInstalledGlobally()}, opts); opts.message = opts.message || 'Update available ' + chalk().dim(this.update.current) + chalk().reset(' → ') + chalk().green(this.update.latest) + ' \nRun ' + chalk().cyan('npm i ' + (opts.isGlobal ? '-g ' : '') + this.packageName) + ' to update'; -- cgit v1.2.3