mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 01:45:50 +08:00 
			
		
		
		
	Make nvm copy-packages refuse to copy packages from the currently activated version.
				
					
				
			This commit is contained in:
		| @@ -0,0 +1,12 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| die () { echo $@ ; exit 1; } | ||||
|  | ||||
| . ../../nvm.sh | ||||
|  | ||||
| local EXPECTED_MSG="Can not copy packages from the current version of node." | ||||
| [ "$(nvm use 0.10.28 && nvm copy-packages 0.10.28 2&>1)" = "$EXPECTED_MSG" ] || die '"nvm use 0.10.28 && nvm copy-packages 0.10.28" did not fail with the right message' | ||||
|  | ||||
| $(nvm use 0.10.28 && nvm copy-packages 0.10.28) | ||||
| [ $? = 2 ] || die '"nvm use 0.10.28 && nvm copy-packages 0.10.28" did not fail with the right error code' | ||||
|  | ||||
		Reference in New Issue
	
	Block a user