File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -75,14 +75,19 @@ install_nvm_from_git() {
75
75
exit 1
76
76
}
77
77
else
78
+ echo " => Cleanup old nvm dir '$INSTALL_DIR '"
79
+ command rm -rf " $INSTALL_DIR /nvm-exec" " $INSTALL_DIR /nvm.sh"
78
80
# Cloning to $INSTALL_DIR
79
81
echo " => Downloading nvm from git to '$INSTALL_DIR '"
80
82
command printf " \r=> "
81
83
mkdir -p " $INSTALL_DIR "
82
- command git clone " $( nvm_source) " " $INSTALL_DIR " || {
84
+ command git init " $INSTALL_DIR "
85
+ command git --git-dir=" $INSTALL_DIR " /.git remote add origin " $( nvm_source) "
86
+ command git --git-dir=" $INSTALL_DIR " /.git pull origin master || {
83
87
echo >&2 " Failed to clone nvm repo. Please report this!"
84
88
exit 1
85
89
}
90
+ command git --git-dir=" $INSTALL_DIR " /.git branch --set-upstream-to=origin/master master
86
91
fi
87
92
command git --git-dir=" $INSTALL_DIR " /.git --work-tree=" $INSTALL_DIR " checkout --quiet " $( nvm_latest_version) "
88
93
if [ ! -z " $( command git --git-dir=" $INSTALL_DIR " /.git --work-tree=" $INSTALL_DIR " show-ref refs/heads/master) " ]; then
You can’t perform that action at this time.
0 commit comments