Skip to content

Commit

Permalink
Update install.sh
Browse files Browse the repository at this point in the history
Clean up origin nvm directory before cloning nvm repository, fix nvm-sh#1212
  • Loading branch information
PeterDaveHello committed Aug 24, 2016
1 parent 31c68ad commit 0cdc0c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ install_nvm_from_git() {
echo "=> Downloading nvm from git to '$INSTALL_DIR'"
command printf "\r=> "
mkdir -p "$INSTALL_DIR"
command git clone "$(nvm_source)" "$INSTALL_DIR" || {
command git init "$INSTALL_DIR"
command git --git-dir="$INSTALL_DIR"/.git remote add origin "$(nvm_source)"
command git --git-dir="$INSTALL_DIR"/.git branch --set-upstream-to=origin/master master
command git --git-dir="$INSTALL_DIR"/.git pull || {
echo >&2 "Failed to clone nvm repo. Please report this!"
exit 1
}
Expand Down

0 comments on commit 0cdc0c2

Please sign in to comment.