From 45c1b84794d446dd8274938c8259cbfd8b846e47 Mon Sep 17 00:00:00 2001 From: Bastian Fuchs Date: Sun, 28 Apr 2019 12:51:15 +0200 Subject: [PATCH] [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. --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index c794623..67349ad 100755 --- a/install.sh +++ b/install.sh @@ -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 }