mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-22 13:50:09 +00:00
npm: only load completion if npm exists
This commit is contained in:
parent
3b8d0ad9d0
commit
136a83433a
1 changed files with 6 additions and 4 deletions
|
@ -1,8 +1,10 @@
|
||||||
__NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion"
|
(( $+commands[npm] )) && {
|
||||||
|
__NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion"
|
||||||
|
|
||||||
if [[ ! -f $__NPM_COMPLETION_FILE ]]; then
|
if [[ ! -f $__NPM_COMPLETION_FILE ]]; then
|
||||||
npm completion >! $__NPM_COMPLETION_FILE || rm -f $__NPM_COMPLETION_FILE
|
npm completion >! $__NPM_COMPLETION_FILE || rm -f $__NPM_COMPLETION_FILE
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
source $__NPM_COMPLETION_FILE
|
source $__NPM_COMPLETION_FILE
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue