Compliance with shellcheck

This commit is contained in:
Xandor Schiefer 2016-11-16 09:50:20 +02:00
parent 19288e279b
commit a41e8018f4

4
nvm.sh
View File

@ -490,8 +490,8 @@ nvm_change_path() {
nvm_echo "${3-}${2-}"
# if the initial path doesnt 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.