From 55d892adc8dddb0e5f4fe62f3001bd90b470bfef Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 17 Jul 2014 00:19:01 -0700 Subject: [PATCH] Fix #476 by making sure to cd into `$NVM_DIR` before checking out the tag. Also delete the master branch, because we won't be needing that. --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index ef3cf16..e45023f 100755 --- a/install.sh +++ b/install.sh @@ -35,8 +35,8 @@ install_nvm_from_git() { if [ -d "$NVM_DIR/.git" ]; then echo "=> nvm is already installed in $NVM_DIR, trying to update" printf "\r=> " - cd "$NVM_DIR" && (git pull 2> /dev/null || { - echo >&2 "Failed to update nvm, run 'git pull' in $NVM_DIR yourself.." && exit 1 + cd "$NVM_DIR" && (git fetch 2> /dev/null || { + echo >&2 "Failed to update nvm, run 'git fetch' in $NVM_DIR yourself." && exit 1 }) else # Cloning to $NVM_DIR @@ -45,7 +45,7 @@ install_nvm_from_git() { mkdir -p "$NVM_DIR" git clone "$NVM_SOURCE" "$NVM_DIR" fi - git checkout v0.11.0 + cd $NVM_DIR && git checkout v0.11.0 && git branch -D master } install_nvm_as_script() {