From 4f081ce4be408bba5881b3a55d59a4dfc1aee7a5 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 23 Sep 2014 23:48:31 -0700 Subject: [PATCH] Collapsing some if/else conditions with elif --- install.sh | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/install.sh b/install.sh index c4ed1db..e72447a 100755 --- a/install.sh +++ b/install.sh @@ -75,21 +75,18 @@ if [ -z "$METHOD" ]; then echo >&2 "You need git, curl, or wget to install nvm" exit 1 fi -else - if [ "~$METHOD" = "~git" ]; then - if ! nvm_has "git"; then - echo >&2 "You need git to install nvm" - exit 1 - fi - install_nvm_from_git +elif [ "~$METHOD" = "~git" ]; then + if ! nvm_has "git"; then + echo >&2 "You need git to install nvm" + exit 1 fi - if [ "~$METHOD" = "~script" ]; then - if ! nvm_has "nvm_download"; then - echo >&2 "You need curl or wget to install nvm" - exit 1 - fi - install_nvm_as_script + install_nvm_from_git +elif [ "~$METHOD" = "~script" ]; then + if ! nvm_has "nvm_download"; then + echo >&2 "You need curl or wget to install nvm" + exit 1 fi + install_nvm_as_script fi echo