[Fix] Determine correct sub directory if XDG_CONFIG_HOME is set

With the environment variable XDG_CONFIG_HOME set, the installation
script uses the directory $XDG_CONFIG_HOME/nvm now. Before the change
the variable's value with "/nvm" cut off was used, which usually results
in an installation without any subdirectory.
Bastian Fuchs 2019-04-28 12:51:15 +02:00 committed by Jordan Harband
parent 3664744e3b
commit 45c1b84794
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 3 additions and 3 deletions

View File

@ -7,10 +7,10 @@ nvm_has() {
}
nvm_default_install_dir() {
if [ -n "$XDG_CONFIG_HOME" ]; then
printf %s "${XDG_CONFIG_HOME/nvm}"
if [ -n "${XDG_CONFIG_HOME-}" ]; then
printf %s "${XDG_CONFIG_HOME}/nvm"
else
printf %s "$HOME/.nvm"
printf %s "${HOME}/.nvm"
fi
}