summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_npm
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command/_npm')
-rw-r--r--Completion/Unix/Command/_npm9
1 files changed, 7 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_npm b/Completion/Unix/Command/_npm
index f5493a321..c05f61c51 100644
--- a/Completion/Unix/Command/_npm
+++ b/Completion/Unix/Command/_npm
@@ -2,8 +2,13 @@
# Node Package Manager completion, letting npm do all the completion work
-if type npm > /dev/null; then
- eval "$(npm completion)"
+if (( $+commands[npm] )); then
+ eval "$(NPM_CONFIG_UPDATE_NOTIFIER=false npm completion)"
+ # Monkey-patch their function to prevent update checks
+ functions[_npm_completion]="
+ local -x NPM_CONFIG_UPDATE_NOTIFIER=false;
+ ${functions[_npm_completion]}
+ "
_npm_completion "$@"
fi