Skip to content

Commit

Permalink
[Fix] declare an unbound variable
Browse files Browse the repository at this point in the history
Fixes #3402
  • Loading branch information
ljharb committed Aug 7, 2024
1 parent 14acd3d commit 4beab63
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 '^$')

Expand All @@ -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
Expand Down

0 comments on commit 4beab63

Please sign in to comment.