af085542bdc0e835093ed2b86f90251bc1f3d719

Author
Alexandre Nicastro <kryndex@gmail.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Stop error "permission denied: /npm_completion" (#6340)

Fixes #5874

Related:
https://github.com/lukechilds/zsh-nvm/issues/23
https://github.com/zsh-users/antigen/issues/586

Diff

 1diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
 2index 43af35ddb4b4090b606c0f0da4c5a4cc0a974843..f62174a4f42c482c488571de293b6eea2e3bfdb2 100644
 3--- a/plugins/npm/npm.plugin.zsh
 4+++ b/plugins/npm/npm.plugin.zsh
 5@@ -1,5 +1,5 @@
 6 (( $+commands[npm] )) && {
 7-    __NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion"
 8+    __NPM_COMPLETION_FILE="${ZSH_CACHE_DIR:-$ZSH/cache}/npm_completion"
 9 
10     if [[ ! -f $__NPM_COMPLETION_FILE ]]; then
11         npm completion >! $__NPM_COMPLETION_FILE 2>/dev/null