failsafe exit if node is installed

This commit is contained in:
AJ ONeal 2018-06-27 10:20:10 +00:00
parent f2a8c2fc49
commit 2309008c5f
1 changed files with 2 additions and 0 deletions

View File

@ -291,6 +291,7 @@ if [ -e "$node_install_path/bin/node" ]; then
# node of some version is already installed
if [ "${NODEJS_VER}" == "$($node_install_path/bin/node -v 2>/dev/null)" ]; then
echo node ${NODEJS_VER} is already installed
exit 0
else
echo ""
echo "HEY, LISTEN:"
@ -299,6 +300,7 @@ if [ -e "$node_install_path/bin/node" ]; then
echo ""
echo "to reinstall as ${NODEJS_VER} please first run: rm $node_install_path/bin/node"
echo ""
exit 1
fi
NODEJS_VER=""