mirror of
https://github.com/lukechilds/zsh-nvm.git
synced 2025-01-30 09:47:14 +08:00
Store previous nvm version when upgrading
This commit is contained in:
parent
a6b8ef980f
commit
96fa6aab57
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
previous_version
|
@ -1,3 +1,5 @@
|
||||
ZSH_NVM_DIR=${0:a:h}
|
||||
|
||||
[[ -z "$NVM_DIR" ]] && NVM_DIR="$HOME/.nvm"
|
||||
|
||||
_zsh_nvm_rename_function() {
|
||||
@ -63,6 +65,7 @@ _zsh_nvm_upgrade() {
|
||||
echo "You're already up to date"
|
||||
else
|
||||
echo "Updating to $latest_version..."
|
||||
echo "$installed_version" > "$ZSH_NVM_DIR/previous_version"
|
||||
$(cd "$NVM_DIR" && git fetch --quiet && git checkout "$latest_version")
|
||||
_zsh_nvm_load
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user