Browse files

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.
  • Loading branch information...
1 parent 3b42df8 commit 55d892adc8dddb0e5f4fe62f3001bd90b470bfef @ljharb ljharb committed Jul 17, 2014
Showing with 3 additions and 3 deletions.
  1. +3 −3
@@ -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
# Cloning to $NVM_DIR
@@ -45,7 +45,7 @@ install_nvm_from_git() {
mkdir -p "$NVM_DIR"
git clone "$NVM_SOURCE" "$NVM_DIR"
- git checkout v0.11.0
+ cd $NVM_DIR && git checkout v0.11.0 && git branch -D master
koenpunt Jul 17, 2014

Why delete the master branch? Is there any advantage of pulling from git now? It probably makes more sense to drop git support altogether, and install from tarball like I suggested in #471.

ljharb Jul 17, 2014 Collaborator

Just for cleanup - then we don't have to worry about it being out of date and getting bug reports from that.

git does a much better job doing deltas - with a tarball download, we'd have to download the entire thing every time.

However, primarily, because tests don't all pass when the repo is outside the NVM_DIR - if we can make development of nvm work properly in arbitrary locations, and not conflict with a user-level installed nvm, that would at least unblock this as an option.

install_nvm_as_script() {

0 comments on commit 55d892a

Please sign in to comment.