From 0cdc0c26b225e8bdf060aefa66739304a8956547 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Wed, 24 Aug 2016 23:09:20 +0800 Subject: [PATCH] Update install.sh Clean up origin nvm directory before cloning nvm repository, fix #1212 --- install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 7f272eef789..67485670f92 100755 --- a/install.sh +++ b/install.sh @@ -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 }