forked from nvm-sh/nvm
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[New] aliases: skip leading blank lines in alias file
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
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
20 changes: 20 additions & 0 deletions
20
test/fast/Aliases/\'nvm alias\' should ignore leading blank lines in the file
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,20 @@ | ||
#!/bin/sh | ||
|
||
die() { echo "$@" ; exit 1; } | ||
|
||
export NVM_DIR="$(cd ../../.. && pwd)" | ||
|
||
\. "${NVM_DIR}/nvm.sh" | ||
\. ../../common.sh | ||
|
||
echo " | ||
v0.0.1 | ||
" > ../../../alias/test-blank-lines | ||
|
||
EXPECTED='v0.0.1' | ||
ACTUAL="$(nvm_alias test-blank-lines)" | ||
EXIT_CODE="$(nvm_alias test-blank-lines 2>&1 >/dev/null; echo $?)" | ||
|
||
[ "${ACTUAL}" = "${EXPECTED}" ] || die "expected >${EXPECTED}<, got >${ACTUAL}<" | ||
[ "${EXIT_CODE}" = '0' ] || die "expected exit code 0, got ${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