Browse Source
better handling of lazy loading node/npm/nvm/yarn
master
No known key found for this signature in database
GPG Key ID: A2ECAB73CE12147F
1 changed files with
18 additions and
1 deletions
-
zshrc.d/lib/functions.zsh
|
|
|
@ -22,10 +22,27 @@ rvm () { |
|
|
|
} |
|
|
|
|
|
|
|
# Setup NVM |
|
|
|
nvm () { |
|
|
|
load_nvm () { |
|
|
|
unset -f node npm yarn |
|
|
|
source $(brew --prefix nvm)/nvm.sh |
|
|
|
} |
|
|
|
nvm () { |
|
|
|
load_nvm |
|
|
|
nvm "$@" |
|
|
|
} |
|
|
|
node () { |
|
|
|
load_nvm |
|
|
|
node "$@" |
|
|
|
} |
|
|
|
npm () { |
|
|
|
load_nvm |
|
|
|
npm "$@" |
|
|
|
} |
|
|
|
yarn () { |
|
|
|
load_nvm |
|
|
|
npm "$@" |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Init chef |
|
|
|
chef () { |
|
|
|
|