mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-12-17 10:44:20 +08:00
[New] add support for $XDG_CONFIG_HOME
This commit is contained in:
committed by
Jordan Harband
parent
f218a85454
commit
8542df4ac5
@@ -54,8 +54,10 @@ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh |
|
||||
|
||||
<sub>The script clones the nvm repository to `~/.nvm` and adds the source line to your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).</sub>
|
||||
|
||||
<sub>**Note:** If the environment variable `$XDG_CONFIG_HOME` is present, it will place the `nvm` files there.</sub>
|
||||
|
||||
```sh
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
export NVM_DIR="${XDG_CONFIG_HOME/:-$HOME/.}nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user