diff options
author | Marc Cornellà <marc.cornella@live.com> | 2016-09-10 00:24:46 +0200 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2016-09-10 00:24:46 +0200 |
commit | ac9a8cb687958d1caf05e69bc7aa5f4297383c09 (patch) | |
tree | 845736a086eff85cb4c6a584c8264f13345314f6 | |
parent | 27fff27253ec7f631f3f9e51f0a9f37214d67f17 (diff) | |
parent | b70842bae4346c793e4932d467dd566baeee7d64 (diff) | |
download | zsh-ac9a8cb687958d1caf05e69bc7aa5f4297383c09.tar.gz zsh-ac9a8cb687958d1caf05e69bc7aa5f4297383c09.tar.bz2 zsh-ac9a8cb687958d1caf05e69bc7aa5f4297383c09.zip |
Merge branch 'fix/cached-npm-completion'
Fixes #5332
-rw-r--r-- | plugins/npm/npm.plugin.zsh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index 30b91ec9c..02e4f3e93 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -2,10 +2,13 @@ __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 + [[ -f $__NPM_COMPLETION_FILE ]] && source $__NPM_COMPLETION_FILE + + unset __NPM_COMPLETION_FILE } # Install dependencies globally |