mirror of
				https://github.com/lukechilds/zsh-nvm.git
				synced 2025-10-30 14:46:28 +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" | [[ -z "$NVM_DIR" ]] && NVM_DIR="$HOME/.nvm" | ||||||
| 
 | 
 | ||||||
| _zsh_nvm_rename_function() { | _zsh_nvm_rename_function() { | ||||||
| @ -63,6 +65,7 @@ _zsh_nvm_upgrade() { | |||||||
|     echo "You're already up to date" |     echo "You're already up to date" | ||||||
|   else |   else | ||||||
|     echo "Updating to $latest_version..." |     echo "Updating to $latest_version..." | ||||||
|  |     echo "$installed_version" > "$ZSH_NVM_DIR/previous_version" | ||||||
|     $(cd "$NVM_DIR" && git fetch --quiet && git checkout "$latest_version") |     $(cd "$NVM_DIR" && git fetch --quiet && git checkout "$latest_version") | ||||||
|     _zsh_nvm_load |     _zsh_nvm_load | ||||||
|   fi |   fi | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Luke Childs
						Luke Childs