Compare commits

...

3 Commits

Author SHA1 Message Date
Tiffany Patek
0d5353df6f
Merge 09c4fcfbed1d52857a4c90fade31f18058f5bf9b into 4beab63631764fc381a0e56273faf8d43b8f9509 2024-08-07 09:40:33 +00:00
Jordan Harband
4beab63631
[Fix] declare an unbound variable
Fixes #3402
2024-08-07 17:38:37 +12:00
Tiffany Patek
09c4fcfbed
Update README.md
Install & Update Script Section

 - Line 96: Added **If you use macOS, you must install Xcode and agree to the Xcode License before you install nvm.**under heading.
 - Line 106: Added **If you don't have a profile file in your home dir, you'll need to add the appropriate one before you run the script.** to the end of the paragraph.
2023-04-19 14:16:50 -06:00
2 changed files with 11 additions and 5 deletions

View File

@ -100,6 +100,8 @@ nvm is a version manager for [node.js](https://nodejs.org/en/), designed to be i
### Install & Update Script ### Install & Update Script
**If you use macOS, you must install Xcode and agree to the Xcode License before you install nvm.**
To **install** or **update** nvm, you should run the [install script][2]. To do that, you may either download and run the script manually, or use the following cURL or Wget command: To **install** or **update** nvm, you should run the [install script][2]. To do that, you may either download and run the script manually, or use the following cURL or Wget command:
```sh ```sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
@ -108,7 +110,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
``` ```
Running either of the above commands downloads a script and runs it. The script clones the nvm repository to `~/.nvm`, and attempts to add the source lines from the snippet below to the correct profile file (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`). Running either of the above commands downloads a script and runs it. The script clones the nvm repository to `~/.nvm`, and attempts to add the source lines from the snippet below to the correct profile file (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`). **If you don't have a profile file in your home dir, you'll need to add the appropriate one before you run the script.**
<a id="profile_snippet"></a> <a id="profile_snippet"></a>
```sh ```sh

12
nvm.sh
View File

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