Browse Source

Merge f2e84ed7cf into 745291dcf2

pull/40/merge
cswl 2 years ago
committed by GitHub
parent
commit
ebb686837c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 39
      zsh-nvm.plugin.zsh

39
zsh-nvm.plugin.zsh

@ -185,23 +185,28 @@ _zsh_nvm_auto_use() {
} }
_zsh_nvm_install_wrapper() { _zsh_nvm_install_wrapper() {
case $2 in local extra_version
'rc') local nodejs_org_mirror
NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc/ nvm install node && nvm alias rc "$(node --version)" local version_list
echo "Clearing mirror cache..." local version_latest
nvm ls-remote > /dev/null 2>&1
echo "Done!" if [[ $2 == 'rc' || $2 == 'nightly' ]]; then
;; extra_version=$2
'nightly') nodejs_org_mirror=https://nodejs.org/download/$extra_version/
NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly/ nvm install node && nvm alias nightly "$(node --version)" version_list="$(NVM_NODEJS_ORG_MIRROR=$nodejs_org_mirror nvm ls-remote |
echo "Clearing mirror cache..." tail -n 1)"
nvm ls-remote > /dev/null 2>&1 version_latest="$(echo "$version_list" \
echo "Done!" | sed -n "s/.*\(v.*\)/\1/p" \
;; | awk '{print $1}' )"
*) echo "Latest $extra_version: $version_latest."
_zsh_nvm_nvm "$@" NVM_NODEJS_ORG_MIRROR=$nodejs_org_mirror \
;; nvm install $version_latest && nvm alias $extra_version "$(node --version)"
esac echo "Clearing mirror cache..."
nvm ls-remote >/dev/null 2>&1
echo "Done!"
else
_zsh_nvm_nvm "$@"
fi
} }
# Don't init anything if this is true (debug/testing only) # Don't init anything if this is true (debug/testing only)

Loading…
Cancel
Save