From a41e8018f41655ca3efd3675bc041d562a7c673c Mon Sep 17 00:00:00 2001 From: Xandor Schiefer Date: Wed, 16 Nov 2016 09:50:20 +0200 Subject: [PATCH] Compliance with shellcheck --- nvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index 2dd6bfe..27fdbf2 100755 --- a/nvm.sh +++ b/nvm.sh @@ -490,8 +490,8 @@ nvm_change_path() { nvm_echo "${3-}${2-}" # if the initial path doesn’t contain an nvm path, prepend the supplementary # path - elif [ `expr "${1-}" : ".*${NVM_DIR}/[^:]*${2-}.*"` = 0 ] || \ - [ `expr "${1-}" : ".*${NVM_DIR}/versions/[^/]*/[^/]*${2-}.*"` = 0 ]; then + elif [ "$(expr "${1-}" : ".*${NVM_DIR}/[^:]*${2-}.*")" = 0 ] || \ + [ "$(expr "${1-}" : ".*${NVM_DIR}/versions/[^/]*/[^/]*${2-}.*")" = 0 ]; then nvm_echo "${3-}${2-}:${1-}" # use sed to replace the existing nvm path with the supplementary path. This # preserves the order of the path.