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 "(copy it back after the install to maintain node.js and io.js separately)"
echo "" echo ""
sleep 3 sleep 3
echo sudo mv "$(which node)" "$(which node).$(node -v)" NODE_PATH=$(which node)
sudo mv "$(which node)" "$(which node).$(node -v)" NODE_VER=$(node -v)
echo sudo mv "$NODE_PATH" "$NODE_PATH.$NODE_VER"
sudo mv "$NODE_PATH" "$NODE_PATH.$NODE_VER"
echo "################################################################################" echo "################################################################################"
echo "to restore backup: sudo rsync -a '$(which node).$(node -v)' '$(which node)'" echo "to restore backup: sudo rsync -a '$(which node).$(node -v)' '$(which node)'"
echo "################################################################################" echo "################################################################################"