[New] add support for $XDG_CONFIG_HOME

This commit is contained in:
Erik Lilja
2018-08-14 21:45:40 +02:00
committed by Jordan Harband
parent f218a85454
commit 8542df4ac5
3 changed files with 13 additions and 4 deletions

View File

@@ -7,7 +7,13 @@ nvm_has() {
}
nvm_install_dir() {
command printf %s "${NVM_DIR:-"$HOME/.nvm"}"
if [ ! -z "$NVM_DIR" ]; then
printf %s "${NVM_DIR}"
elif [ ! -z "$XDG_CONFIG_HOME" ]; then
printf %s "${XDG_CONFIG_HOME/nvm}"
else
printf %s "$HOME/.nvm"
fi
}
nvm_latest_version() {