Browse Source

Wrap nvm install to add support for rc/nightly

yarn-unset-notice
Luke Childs 8 years ago
parent
commit
3d6c5606b2
  1. 17
      zsh-nvm.plugin.zsh

17
zsh-nvm.plugin.zsh

@ -61,6 +61,9 @@ _zsh_nvm_load() {
_zsh_nvm_nvm "$@" _zsh_nvm_nvm "$@"
export NVM_AUTO_USE_ACTIVE=false export NVM_AUTO_USE_ACTIVE=false
;; ;;
'install')
_zsh_nvm_install_wrapper "$@"
;;
*) *)
_zsh_nvm_nvm "$@" _zsh_nvm_nvm "$@"
;; ;;
@ -172,6 +175,20 @@ _zsh_nvm_auto_use() {
fi fi
} }
_zsh_nvm_install_wrapper() {
case $2 in
'rc')
NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc/ nvm install node
;;
'nightly')
NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly/ nvm install node
;;
*)
_zsh_nvm_nvm "$@"
;;
esac
}
# Don't init anything if this is true (debug/testing only) # Don't init anything if this is true (debug/testing only)
if [[ "$ZSH_NVM_NO_LOAD" != true ]]; then if [[ "$ZSH_NVM_NO_LOAD" != true ]]; then

Loading…
Cancel
Save