mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-09-09 15:59:22 +00: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