-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename
nvm copy-packages
to nvm reinstall-packages
, and `--copy-p…
…ackages-from` install option to `--reinstall-packages-from` For #341. `nvm copy-packages` and install option `--copy-packages-from` will continue to be supported for for at least a full minor release version.
- Loading branch information
Showing
11 changed files
with
77 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
test/fast/Running "nvm install" with "--copy-packages-from" requires a valid version
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
test/fast/Running "nvm install" with "--reinstall-packages-from" requires a valid version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
|
||
die () { echo $@ ; cleanup ; exit 1; } | ||
cleanup () { | ||
rm -rf ../../v0.10.4 | ||
} | ||
|
||
mkdir ../../v0.10.4 | ||
|
||
. ../../nvm.sh | ||
|
||
nvm deactivate >/dev/null 2>&1 | ||
|
||
INSTALL_ERROR_MSG="$(nvm install v0.10.5 --reinstall-packages-from=0.11 2>&1)" | ||
EXPECTED_ERROR_MSG="If --reinstall-packages-from is provided, it must point to an installed version of node." | ||
[ "~$INSTALL_ERROR_MSG" = "~$EXPECTED_ERROR_MSG" ] \ | ||
|| die ""nvm install --reinstall-packages-from" should fail when given an uninstalled version: expected '$EXPECTED_ERROR_MSG', got '$INSTALL_ERROR_MSG'" | ||
|
||
INSTALL_EXIT_CODE="$(nvm install v0.10.5 --reinstall-packages-from=0.11 >/dev/null 2>&1; echo $?)" | ||
[ "~$INSTALL_EXIT_CODE" = "~5" ] \ | ||
|| die ""nvm install --reinstall-packages-from" should exit with code 5 when given an uninstalled version, got $INSTALL_EXIT_CODE" | ||
|
||
INSTALL_ERROR_MSG="$(nvm install v0.10.5 --reinstall-packages-from=0.10.5 2>&1)" | ||
EXPECTED_ERROR_MSG="You can't reinstall global packages from the same version of node you're installing." | ||
[ "~$INSTALL_ERROR_MSG" = "~$EXPECTED_ERROR_MSG" ] \ | ||
|| die ""nvm install --reinstall-packages-from" should fail when given the same version: expected '$EXPECTED_ERROR_MSG', got '$INSTALL_ERROR_MSG'" | ||
|
||
INSTALL_EXIT_CODE="$(nvm install v0.10.5 --reinstall-packages-from=0.10.5 >/dev/null 2>&1; echo $?)" | ||
[ "~$INSTALL_EXIT_CODE" = "~4" ] \ | ||
|| die ""nvm install --reinstall-packages-from" should exit with code 4 when given the same version, got $INSTALL_EXIT_CODE" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
test/slow/nvm copy-packages/Running "nvm copy-packages $(nvm ls current)" should error out
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
...low/nvm reinstall-packages/Running "nvm copy-packages $(nvm ls current)" should error out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
die () { echo $@ ; exit 1; } | ||
|
||
. ../../../nvm.sh | ||
|
||
nvm use 0.10.28 > /dev/null | ||
|
||
EXPECTED_MSG="Can not reinstall packages from the current version of node." | ||
ACTUAL_MSG="$(nvm reinstall-packages 0.10.28 2>&1 > /dev/null)" | ||
[ "~$ACTUAL_MSG" = "~$EXPECTED_MSG" ] || die "'nvm use 0.10.28 && nvm reinstall-packages 0.10.28' did not fail with the right message: '$ACTUAL_MESSAGE'" | ||
|
||
EXPECTED_ERROR_CODE="2" | ||
ACTUAL_ERROR_CODE="$(nvm reinstall-packages 0.10.28 > /dev/null 2>&1 ; echo $?)" | ||
[ "~$ACTUAL_ERROR_CODE" = "~$EXPECTED_ERROR_CODE" ] || die "'nvm use 0.10.28 && nvm reinstall-packages 0.10.28' did not fail with the right error code: expected '$EXPECTED_ERROR_CODE', got '$ACTUAL_ERROR_CODE'" | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Cannot