-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
57a600a
commit d11bc3f
Showing
1 changed file
with
26 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
die () { echo $@ ; exit 1; } | ||
|
||
. ../../../nvm.sh | ||
|
||
echo "0.10.7" > .nvmrc | ||
|
||
# Check nvm run without --silent | ||
OUTPUT="$(nvm run --version | awk '{print $6}')" | ||
EXPECTED_OUTPUT="<v0.10.7>" | ||
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] / | ||
|| die "\`nvm run\` failed to run; did not match with the .nvmrc version; got >${OUTPUT}<" | ||
|
||
OUTPUT="$(nvm run --silent --version)" | ||
EXPECTED_OUTPUT="" | ||
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] / | ||
|| die "\`nvm run --silent\` failed to run silently; expected no output, got >${OUTPUT}<" | ||
|
||
# Output shouldn't be silent if --silent flag is not at the third argument position | ||
OUTPUT="$(nvm run --version --silent)" | ||
EXPECTED_OUTPUT="" | ||
[ "${OUTPUT}" -ne "${EXPECTED_OUTPUT}" ] / | ||
|| die "\`nvm run --version --silent\` should not be silent; expected >${OUTPUT}<, got no output" |