From c16919becdf4aae91bdb1ecdda7c49e4b68cf52a Mon Sep 17 00:00:00 2001 From: Jarrett Chisholm Date: Thu, 5 Mar 2015 18:21:46 -0500 Subject: [PATCH] - fixed return code of 1 when updating from git --- install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 78e54f9..a141373 100755 --- a/install.sh +++ b/install.sh @@ -69,7 +69,10 @@ install_nvm_from_git() { mkdir -p "$NVM_DIR" command git clone "$(nvm_source git)" "$NVM_DIR" fi - cd "$NVM_DIR" && command git checkout --quiet $(nvm_latest_version) && command git branch --quiet -D master >/dev/null 2>&1 + cd "$NVM_DIR" && command git checkout --quiet $(nvm_latest_version) + if [ ! -z "$(cd "$NVM_DIR" && git show-ref refs/heads/master)" ]; then + cd "$NVM_DIR" && command git branch --quiet -D master >/dev/null 2>&1 + fi return }