mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-30 09:18:59 +08:00 
			
		
		
		
	utility method for append path, fixes #414
This commit is contained in:
		
							
								
								
									
										18
									
								
								test/fast/Unit tests/nvm_prepend_path
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										18
									
								
								test/fast/Unit tests/nvm_prepend_path
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| die () { echo $@ ; exit 1; } | ||||
|  | ||||
| . ../../../nvm.sh | ||||
|  | ||||
| TEST_PATH=/usr/bin:/usr/local/bin | ||||
|  | ||||
| NEW_PATH=`nvm_prepend_path "$TEST_PATH" "$NVM_DIR/v0.2.5/bin"` | ||||
|  | ||||
| [ "$NEW_PATH" = "$NVM_DIR/v0.2.5/bin:/usr/bin:/usr/local/bin" ] || die "Not correctly prepended: $STRIPPED_PATH " | ||||
|  | ||||
|  | ||||
| EMPTY_PATH= | ||||
|  | ||||
| NEW_PATH=`nvm_prepend_path "$EMPTY_PATH" "$NVM_DIR/v0.2.5/bin"` | ||||
|  | ||||
| [ "$NEW_PATH" = "$NVM_DIR/v0.2.5/bin" ] || die "Not correctly prepended: $STRIPPED_PATH " | ||||
		Reference in New Issue
	
	Block a user