diff --git a/install.sh b/install.sh index 2ebba30..85babf5 100755 --- a/install.sh +++ b/install.sh @@ -7,7 +7,7 @@ nvm_has() { } nvm_install_dir() { - echo "${NVM_DIR:-"$HOME/.nvm"}" + printf %s "${NVM_DIR:-"$HOME/.nvm"}" | sed "s:^$HOME:\$HOME:" } nvm_latest_version() { diff --git a/test/install_script/nvm_install_dir b/test/install_script/nvm_install_dir index 1c685e3..94c784f 100755 --- a/test/install_script/nvm_install_dir +++ b/test/install_script/nvm_install_dir @@ -19,7 +19,7 @@ unset NVM_DIR # NVM_DIR is not set install_dir=$(nvm_install_dir) -[ "_$install_dir" = "_$HOME/.nvm" ] || die "nvm_install_dir should default to \$HOME/.nvm. Current output: $install_dir" +[ "_$install_dir" = "_\$HOME/.nvm" ] || die "nvm_install_dir should default to \$HOME/.nvm. Current output: $install_dir" cleanup