Compare commits

...

3 Commits

Author SHA1 Message Date
Roy Ivy III
3d11880f17
Merge cae2eb71a2d7edd13a16b86d1bc0f749b25fd290 into 4beab63631764fc381a0e56273faf8d43b8f9509 2024-08-07 09:40:02 +00:00
Jordan Harband
4beab63631
[Fix] declare an unbound variable
Fixes #3402
2024-08-07 17:38:37 +12:00
Roy Ivy III
cae2eb71a2 [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.
2024-05-03 00:36:04 -05:00
2 changed files with 10 additions and 5 deletions

View File

@ -163,7 +163,8 @@ install_nvm_from_git() {
}
else
# Cloning repo
command git clone "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || {
command git clone "$(nvm_source)" --depth=1 -o origin "${INSTALL_DIR}" 2> /dev/null \
|| command git clone "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || {
nvm_echo >&2 'Failed to clone nvm repo. Please report this!'
exit 2
}

12
nvm.sh
View File

@ -503,9 +503,9 @@ $(nvm_wrap_with_color_code 'y' "${warn_text}")"
}
nvm_process_nvmrc() {
local NVMRC_PATH="$1"
local NVMRC_PATH
NVMRC_PATH="$1"
local lines
local unpaired_line
lines=$(command sed 's/#.*//' "$NVMRC_PATH" | command sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | nvm_grep -v '^$')
@ -515,8 +515,12 @@ nvm_process_nvmrc() {
fi
# Initialize key-value storage
local keys=''
local values=''
local keys
keys=''
local values
values=''
local unpaired_line
unpaired_line=''
while IFS= read -r line; do
if [ -z "${line}" ]; then