mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	Add nvm_node_prefix
				
					
				
			This commit is contained in:
		
							
								
								
									
										5
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -350,6 +350,9 @@ nvm_resolve_alias() { | |||||||
| nvm_iojs_prefix() { | nvm_iojs_prefix() { | ||||||
|   echo "iojs" |   echo "iojs" | ||||||
| } | } | ||||||
|  | nvm_node_prefix() { | ||||||
|  |   echo "node" | ||||||
|  | } | ||||||
|  |  | ||||||
| nvm_ls() { | nvm_ls() { | ||||||
|   local PATTERN |   local PATTERN | ||||||
| @@ -1194,7 +1197,7 @@ nvm() { | |||||||
|     ;; |     ;; | ||||||
|     "unload" ) |     "unload" ) | ||||||
|       unset -f nvm nvm_print_versions nvm_checksum \ |       unset -f nvm nvm_print_versions nvm_checksum \ | ||||||
|         nvm_iojs_prefix \ |         nvm_iojs_prefix nvm_node_prefix \ | ||||||
|         nvm_ls_remote nvm_ls nvm_remote_version \ |         nvm_ls_remote nvm_ls nvm_remote_version \ | ||||||
|         nvm_version nvm_rc_version \ |         nvm_version nvm_rc_version \ | ||||||
|         nvm_version_greater nvm_version_greater_than_or_equal_to \ |         nvm_version_greater nvm_version_greater_than_or_equal_to \ | ||||||
|   | |||||||
							
								
								
									
										7
									
								
								test/fast/Unit tests/nvm_node_prefix
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										7
									
								
								test/fast/Unit tests/nvm_node_prefix
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,7 @@ | |||||||
|  | #!/bin/sh | ||||||
|  |  | ||||||
|  | die () { echo $@ ; exit 1; } | ||||||
|  |  | ||||||
|  | . ../../../nvm.sh | ||||||
|  |  | ||||||
|  | [ "$(nvm_node_prefix)" = "node" ] || die '"nvm_node_prefix" did not return the string "node". why did this fail?!' | ||||||
		Reference in New Issue
	
	Block a user