Compare commits

...

3 Commits

Author SHA1 Message Date
Hasham
cf4afb212f
Merge 510d152ee5678cbff4a3f0f55b9ed2ad699b7c55 into 4beab63631764fc381a0e56273faf8d43b8f9509 2024-08-07 09:40:36 +00:00
Jordan Harband
4beab63631
[Fix] declare an unbound variable
Fixes #3402
2024-08-07 17:38:37 +12:00
hasham7861
510d152ee5 [Tag]: removing cdnvm command in readme for bashrc file
There is an uncessary `cdnvm "$PWD" || exit` taking place and not all the systems that have bash come with it, so its uncessary
2023-11-16 19:59:15 -05:00
2 changed files with 9 additions and 5 deletions

View File

@ -646,7 +646,7 @@ cdnvm() {
}
alias cd='cdnvm'
cdnvm "$PWD" || exit
```
This alias would search 'up' from your current directory in order to detect a `.nvmrc` file. If it finds it, it will switch to that version; if not, it will use the default version.

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