summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
authordana <dana@dana.is>2018-11-13 13:06:29 -0600
committerdana <dana@dana.is>2018-11-13 13:06:29 -0600
commite25f890589dce079f595b4a53388fb6a0e3abb9e (patch)
tree418ec36500a09f04b9a6062ae3207e45154d01f6 /Completion/Unix
parentdf12f6cd2f8f4a9523e78d1c29d3abad03622036 (diff)
downloadzsh-e25f890589dce079f595b4a53388fb6a0e3abb9e.tar.gz
zsh-e25f890589dce079f595b4a53388fb6a0e3abb9e.tar.xz
zsh-e25f890589dce079f595b4a53388fb6a0e3abb9e.zip
43809: Suppress npm update checks during completion
Diffstat (limited to 'Completion/Unix')
-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