diff --git a/zshrc.d/lib/functions.zsh b/zshrc.d/lib/functions.zsh index 727c3d0..79de18b 100644 --- a/zshrc.d/lib/functions.zsh +++ b/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 () {