From 6dd6a0d213703a516df545970f4d8964319ede47 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 10 May 2016 01:17:31 -0700 Subject: [PATCH] [Fix] `dash` does not support string substitution :-( --- nvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index 30c6afd..45e6b28 100644 --- a/nvm.sh +++ b/nvm.sh @@ -1672,10 +1672,10 @@ nvm_sanitize_path() { local SANITIZED_PATH SANITIZED_PATH="${1-}" if [ "_$SANITIZED_PATH" != "_$NVM_DIR" ]; then - SANITIZED_PATH="${SANITIZED_PATH/#$NVM_DIR/\$NVM_DIR}" + SANITIZED_PATH="$(nvm_echo "$SANITIZED_PATH" | command sed -e "s#$NVM_DIR#\$NVM_DIR#g")" fi if [ "_$SANITIZED_PATH" != "_$HOME" ]; then - SANITIZED_PATH="${SANITIZED_PATH/#$HOME/\$HOME}" + SANITIZED_PATH="$(nvm_echo "$SANITIZED_PATH" | command sed -e "s#$HOME#\$HOME#g")" fi nvm_echo "$SANITIZED_PATH" }