Merge pull request #622 from ohcibi/master

Prefer tee over > to maximize compatibility
master
Jordan Harband 2015-01-23 01:52:52 -08:00
commit 223f388693
2 changed files with 22 additions and 1 deletions

2
nvm.sh
View File

@ -1448,7 +1448,7 @@ $NVM_LS_REMOTE_IOJS_OUTPUT" | command grep -v "N/A" | sed '/^$/d')"
if [ $? -ne 0 ]; then
echo "! WARNING: Version '$3' does not exist." >&2
fi
echo "$3" > "$NVM_ALIAS_DIR/$2"
echo "$3" | tee "$NVM_ALIAS_DIR/$2"
if [ ! "_$3" = "_$VERSION" ]; then
echo "$2 -> $3 (-> $VERSION)"
else

View File

@ -0,0 +1,21 @@
#!/bin/sh
. ../../../nvm.sh
die () { echo $@ ; exit 1; }
if [ -n "$ZSH_VERSION" ]; then
# set clobber option in order to test that this does not produce any
# incompatibilities
setopt noclobber
fi
nvm alias test-stable-1 0.0.2
nvm alias test-stable-1 | \grep -e "test-stable-1 -> 0.0.2 (-> v0.0.2)" \
|| die "nvm alias test-stable-1 0.0.2 did not set test-stable-1 to 0.0.2"
nvm alias test-stable-1 0.0.1
nvm alias test-stable-1 | \grep -e "test-stable-1 -> 0.0.1 (-> v0.0.1)" \
|| die "nvm alias test-stable-1 0.0.1 did not set test-stable-1 to 0.0.1"