Skip to content

Commit cae2eb7

Browse files
committed
[Fix] specify 'origin' remote name with git clone ... installs
`git` may be configured locally to use a non-'origin' default remote name. So, specify 'origin' as the remote name when cloning to get the expected setup.
1 parent 811c039 commit cae2eb7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

install.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ install_nvm_from_git() {
163163
}
164164
else
165165
# Cloning repo
166-
command git clone "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || {
166+
command git clone "$(nvm_source)" --depth=1 -o origin "${INSTALL_DIR}" 2> /dev/null \
167+
|| command git clone "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || {
167168
nvm_echo >&2 'Failed to clone nvm repo. Please report this!'
168169
exit 2
169170
}

0 commit comments

Comments
 (0)