From b5d9e547f2538e073186ccd403dd075529c3ec31 Mon Sep 17 00:00:00 2001 From: Tobias Witt Date: Wed, 21 Jan 2015 23:02:20 +0100 Subject: [PATCH] Use `tee` to replace the alias files content instead of `>` As mentioned in #615 it is possible to configure `>` to not override existing files by default. `tee` is a standard tool that can be used shell independent. --- nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index fbbf663..ee13d9d 100644 --- a/nvm.sh +++ b/nvm.sh @@ -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