summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/update-notifier/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/update-notifier/index.js')
-rw-r--r--deps/npm/node_modules/update-notifier/index.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/deps/npm/node_modules/update-notifier/index.js b/deps/npm/node_modules/update-notifier/index.js
index a5fff01036..58f2459036 100644
--- a/deps/npm/node_modules/update-notifier/index.js
+++ b/deps/npm/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';