From 00c986e483784c984f8ba0cd0f500551f31bdb29 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 20 Jun 2018 02:06:38 +0000 Subject: [PATCH] regression fix: allow empty NODEJS_VER --- install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 55c087d..ffdcfe5 100644 --- a/install.sh +++ b/install.sh @@ -254,11 +254,14 @@ my_char="." my_count=$(awk -F"${my_char}" '{print NF-1}' <<< "${NODEJS_VER}") # get the latest version if partial if [ $my_count -ne 2 ]; then + if [ "$my_count" -ne "v" ]; then + NODEJS_VER="$NODEJS_VER\\." + fi if [ -n "$(type -p curl)" ]; then - NODEJS_VER=$(curl -fsL "$NODEJS_BASE_URL/dist/index.tab" | tail -n +2 | cut -f 1 | grep "^$NODEJS_VER\." | head -n 1) \ + NODEJS_VER=$(curl -fsL "$NODEJS_BASE_URL/dist/index.tab" | tail -n +2 | cut -f 1 | grep "^$NODEJS_VER" | head -n 1) \ || echo 'error automatically determining current node.js version' elif [ -n "$(type -p wget)" ]; then - NODEJS_VER=$(wget --quiet "$NODEJS_BASE_URL/dist/index.tab" -O - | tail -n +2 | cut -f 1 | grep "^$NODEJS_VER\." | head -n 1) \ + NODEJS_VER=$(wget --quiet "$NODEJS_BASE_URL/dist/index.tab" -O - | tail -n +2 | cut -f 1 | grep "^$NODEJS_VER" | head -n 1) \ || echo 'error automatically determining current node.js version' else echo "Found neither 'curl' nor 'wget'. Can't Continue."