From 3d6c5606b2b204169189503b567c83f61aad46e5 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Mon, 29 May 2017 17:26:54 +0700 Subject: [PATCH] Wrap nvm install to add support for rc/nightly --- zsh-nvm.plugin.zsh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/zsh-nvm.plugin.zsh b/zsh-nvm.plugin.zsh index 77599c8..f93a578 100644 --- a/zsh-nvm.plugin.zsh +++ b/zsh-nvm.plugin.zsh @@ -61,6 +61,9 @@ _zsh_nvm_load() { _zsh_nvm_nvm "$@" export NVM_AUTO_USE_ACTIVE=false ;; + 'install') + _zsh_nvm_install_wrapper "$@" + ;; *) _zsh_nvm_nvm "$@" ;; @@ -172,6 +175,20 @@ _zsh_nvm_auto_use() { 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) if [[ "$ZSH_NVM_NO_LOAD" != true ]]; then