Update setup-ubuntu.bash

This commit is contained in:
AJ ONeal 2015-01-15 14:34:11 -07:00
parent 14d64876cc
commit 6433047dab
1 changed files with 11 additions and 2 deletions

View File

@ -24,12 +24,21 @@ then
fi fi
# iojs # iojs
if [ -n "$(which iojs | grep iojs 2>/dev/null)" ]; then if [ -n "$(which node | grep node 2>/dev/null)" ]; then
IOJS_VER="" IOJS_VER=""
if [ "$(node -v 2>/dev/null)" != "$(iojs -v 2>/dev/null)" ]; then
echo "You have node.js installed. Backing up $(which node) as $(which node).joyent"
echo "(you can move it back after the install if you want separate node.js and io.js installations)"
echo ""
echo sudo mv "$(which node)" "$(which node).joyent"
sudo mv "$(which node)" "$(which node).joyent"
fi
if [ "${IOJS_VER}" == "$(iojs -v 2>/dev/null)" ]; then if [ "${IOJS_VER}" == "$(iojs -v 2>/dev/null)" ]; then
echo iojs ${IOJS_VER} already installed echo iojs ${IOJS_VER} already installed
else else
clear
echo "" echo ""
echo "HEY, LISTEN:" echo "HEY, LISTEN:"
echo "io.js is already installed as iojs $(iojs -v | grep v)" echo "io.js is already installed as iojs $(iojs -v | grep v)"