From 356ac7a69778beebce9a44d64394e37e17e2439a Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 22 Apr 2015 00:40:27 -0700 Subject: [PATCH] install.sh: Ensure that the `--quiet` option is available before trying to use it. Fixes #738, #657. --- install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index dea8f52..4619fa0 100755 --- a/install.sh +++ b/install.sh @@ -71,7 +71,12 @@ install_nvm_from_git() { fi 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 + if git branch --quiet 2>/dev/null; then + cd "$NVM_DIR" && command git branch --quiet -D master >/dev/null 2>&1 + else + echo >&2 "Your version of git is out of date. Please update it!" + cd "$NVM_DIR" && command git branch -D master >/dev/null 2>&1 + fi fi return }