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.
master
Tobias Witt 2015-01-21 23:02:20 +01:00
parent dd146519a2
commit b5d9e547f2
No known key found for this signature in database
GPG Key ID: F4AB9D0041E48E7E
1 changed files with 1 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