From 2d0c025c499e7c592b356b9cb659f2f2b663ccb5 Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Wed, 26 Mar 2014 09:16:26 +0100 Subject: [PATCH] Prevent fallback --- install.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index a414160..e272305 100755 --- a/install.sh +++ b/install.sh @@ -61,13 +61,15 @@ install_as_script() { } if [ -z "$METHOD" ]; then - install_from_git || { - echo >&2 "Install using git failed, falling to back to script" - install_as_script || { - echo >&2 "You need git, curl or wget to install nvm" - exit 1 - } - } + # Autodetect install method + if has "git"; then + install_from_git + elif has "curl" || has "wget"; then + install_as_script + else + echo >&2 "You need git, curl or wget to install nvm" + exit 1 + fi else if [ "$METHOD" = "git" ]; then install_from_git || {