mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 18:25:52 +08:00 
			
		
		
		
	Check $# before trying to check $1. Avoids failure due to nounset bash option.
				
					
				
			Partially fixes #868.
This commit is contained in:
		
							
								
								
									
										2
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -2235,7 +2235,7 @@ nvm_supports_xz() { | |||||||
| } | } | ||||||
|  |  | ||||||
| NVM_VERSION="$(nvm_alias default 2>/dev/null || echo)" | NVM_VERSION="$(nvm_alias default 2>/dev/null || echo)" | ||||||
| if nvm_supports_source_options && [ "_$1" = "_--install" ]; then | if nvm_supports_source_options && [ "$#" -gt 0 ] && [ "_$1" = "_--install" ]; then | ||||||
|   if [ -n "$NVM_VERSION" ]; then |   if [ -n "$NVM_VERSION" ]; then | ||||||
|     nvm install "$NVM_VERSION" >/dev/null |     nvm install "$NVM_VERSION" >/dev/null | ||||||
|   elif nvm_rc_version >/dev/null 2>&1; then |   elif nvm_rc_version >/dev/null 2>&1; then | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user