1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-29 01:00:08 +00:00

Create and cache npm completion on first run

Signed-off-by: Marc Cornellà <marc.cornella@live.com>
This commit is contained in:
Philipp Wahala 2016-02-29 10:16:26 +01:00 committed by Marc Cornellà
parent 4b9772fffe
commit 7c1ca0e4d8

View file

@ -1,4 +1,10 @@
eval "$(npm completion 2>/dev/null)" __NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion"
if [[ ! -f $__NPM_COMPLETION_FILE ]]; then
npm completion >! $__NPM_COMPLETION_FILE || rm -f $__NPM_COMPLETION_FILE
fi
source $__NPM_COMPLETION_FILE
# Install dependencies globally # Install dependencies globally
alias npmg="npm i -g " alias npmg="npm i -g "