mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	Make nvm_resolve_local_alias not return N/A - that should be done as shallowly as possible.
				
					
				
			This commit is contained in:
		
							
								
								
									
										1
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -478,7 +478,6 @@ nvm_resolve_local_alias() { | |||||||
|   VERSION="$(nvm_resolve_alias "$1")" |   VERSION="$(nvm_resolve_alias "$1")" | ||||||
|   EXIT_CODE=$? |   EXIT_CODE=$? | ||||||
|   if [ -z "$VERSION" ]; then |   if [ -z "$VERSION" ]; then | ||||||
|     echo "N/A" |  | ||||||
|     return $EXIT_CODE |     return $EXIT_CODE | ||||||
|   fi |   fi | ||||||
|   if [ "_$VERSION" != "_∞" ]; then |   if [ "_$VERSION" != "_∞" ]; then | ||||||
|   | |||||||
| @@ -20,7 +20,7 @@ done | |||||||
| OUTPUT="$(nvm_resolve_local_alias nonexistent)" | OUTPUT="$(nvm_resolve_local_alias nonexistent)" | ||||||
| EXIT_CODE=$(nvm_resolve_local_alias nonexistent > /dev/null 2>&1 ; echo $?) | EXIT_CODE=$(nvm_resolve_local_alias nonexistent > /dev/null 2>&1 ; echo $?) | ||||||
| [ "_$EXIT_CODE" = "_2" ] || die "'nvm_resolve_local_alias nonexistent' did not return 2; got $EXIT_CODE" | [ "_$EXIT_CODE" = "_2" ] || die "'nvm_resolve_local_alias nonexistent' did not return 2; got $EXIT_CODE" | ||||||
| [ "_$OUTPUT" = "_N/A" ] || die "'nvm_resolve_local_alias nonexistent' did not output N/A; got $OUTPUT" | [ "_$OUTPUT" = "_" ] || die "'nvm_resolve_local_alias nonexistent' did not have empty output; got $OUTPUT" | ||||||
|  |  | ||||||
| STABLE="$(nvm_resolve_local_alias stable)" | STABLE="$(nvm_resolve_local_alias stable)" | ||||||
| [ "_$STABLE" = "_v0.0.10" ] || die "'nvm_resolve_local_alias stable' was not v0.0.10; got $STABLE" | [ "_$STABLE" = "_v0.0.10" ] || die "'nvm_resolve_local_alias stable' was not v0.0.10; got $STABLE" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user