mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 18:25:52 +08:00 
			
		
		
		
	[Docs] [Fix] zsh autochange: only nvm install if we can’t nvm use
				
					
				
			This commit is contained in:
		| @@ -322,8 +322,10 @@ load-nvmrc() { | |||||||
|   if [ -n "$nvmrc_path" ]; then |   if [ -n "$nvmrc_path" ]; then | ||||||
|     local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")") |     local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")") | ||||||
|  |  | ||||||
|     if [ "$nvmrc_node_version" != "N/A" ] && [ "$nvmrc_node_version" != "$node_version" ]; then |     if [ "$nvmrc_node_version" = "N/A" ]; then | ||||||
|       nvm install |       nvm install | ||||||
|  |     elif [ "$nvmrc_node_version" != "$node_version" ]; then | ||||||
|  |       nvm use | ||||||
|     fi |     fi | ||||||
|   elif [ "$node_version" != "$(nvm version default)" ]; then |   elif [ "$node_version" != "$(nvm version default)" ]; then | ||||||
|     echo "Reverting to nvm default version" |     echo "Reverting to nvm default version" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user