forked from nvm-sh/nvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5dacdf
commit 218439b
Showing
2 changed files
with
65 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
cleanup () { | ||
nvm cache clear | ||
nvm deactivate | ||
rm -rf ${NVM_DIR}/v* | ||
nvm unalias default | ||
} | ||
|
||
die () { >&2 echo "$@" ; cleanup ; exit 1; } | ||
|
||
\. ../../../nvm.sh | ||
|
||
nvm_has_colors() { return 1 ; } | ||
|
||
cleanup | ||
|
||
OUTPUT="$(2>&1 nvm install --no-progress v0.12.18)" | ||
EXPECTED_OUTPUT="Downloading and installing node v0.12.18... | ||
Downloading https://nodejs.org/dist/v0.12.18/node-v0.12.18-linux-x64.tar.xz... | ||
Computing checksum with sha256sum | ||
Checksums matched! | ||
Now using node v0.12.18 (npm v2.15.11) | ||
Creating default alias: default -> v0.12.18 *" | ||
|
||
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "expected >${EXPECTED_OUTPUT}<, got >${OUTPUT}<" | ||
|
||
cleanup | ||
|
||
OUTPUT="$(2>&1 nvm install v0.12.18)" | ||
EXPECTED_OUTPUT="Downloading and installing node v0.12.18... | ||
Downloading https://nodejs.org/dist/v0.12.18/node-v0.12.18-linux-x64.tar.xz... | ||
######################################################################## 100.0% | ||
Computing checksum with sha256sum | ||
Checksums matched! | ||
Now using node v0.12.18 (npm v2.15.11) | ||
Creating default alias: default -> v0.12.18 *" | ||
|
||
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "expected >${EXPECTED_OUTPUT}<, got >${OUTPUT}<" | ||
|
||
cleanup |