mirror of
https://github.com/lukechilds/zsh-nvm.git
synced 2025-01-30 09:47:14 +08:00
Add update function
This commit is contained in:
parent
34e7a4d28d
commit
2babe68372
@ -26,6 +26,16 @@ _zsh_nvm_install() {
|
|||||||
git checkout --quiet "$(_zsh_nvm_latest_release_tag)"
|
git checkout --quiet "$(_zsh_nvm_latest_release_tag)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nvm_update() {
|
||||||
|
echo "Checking latest version of nvm..."
|
||||||
|
local latest_version=$(_zsh_nvm_latest_release_tag)
|
||||||
|
echo "Latest version is $latest_version"
|
||||||
|
echo "Fetching updates..."
|
||||||
|
cd "$NVM_DIR"
|
||||||
|
git fetch
|
||||||
|
git checkout "$latest_version"
|
||||||
|
}
|
||||||
|
|
||||||
# Install nvm if it isn't already installed
|
# Install nvm if it isn't already installed
|
||||||
[[ ! -f "$NVM_DIR/nvm.sh" ]] && _zsh_nvm_install
|
[[ ! -f "$NVM_DIR/nvm.sh" ]] && _zsh_nvm_install
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user