store node path & ver before moving

This commit is contained in:
AJ ONeal 2015-01-17 18:23:25 -07:00
parent 52d1bd8cdc
commit 331f4eadb9
1 changed files with 4 additions and 2 deletions

View File

@ -237,8 +237,10 @@ elif [ "$(node -v 2>/dev/null)" != "$(iojs -v 2>/dev/null)" ]; then
echo "(copy it back after the install to maintain node.js and io.js separately)"
echo ""
sleep 3
echo sudo mv "$(which node)" "$(which node).$(node -v)"
sudo mv "$(which node)" "$(which node).$(node -v)"
NODE_PATH=$(which node)
NODE_VER=$(node -v)
echo sudo mv "$NODE_PATH" "$NODE_PATH.$NODE_VER"
sudo mv "$NODE_PATH" "$NODE_PATH.$NODE_VER"
echo "################################################################################"
echo "to restore backup: sudo rsync -a '$(which node).$(node -v)' '$(which node)'"
echo "################################################################################"