Browse Source

npm: quiet error output of npm completion

Marc Cornellà 8 years ago
parent
commit
2a44527ac3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      plugins/npm/npm.plugin.zsh

+ 2 - 1
plugins/npm/npm.plugin.zsh

@@ -2,7 +2,8 @@
     __NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion"
 
     if [[ ! -f $__NPM_COMPLETION_FILE ]]; then
-        npm completion >! $__NPM_COMPLETION_FILE || rm -f $__NPM_COMPLETION_FILE
+        npm completion >! $__NPM_COMPLETION_FILE 2>/dev/null
+        [[ $? -ne 0 ]] && rm -f $__NPM_COMPLETION_FILE
     fi
 
     source $__NPM_COMPLETION_FILE