From a3331ffdb0a3630d8f5ba3efd22d49778c0b8fba Mon Sep 17 00:00:00 2001 From: Fraser Tweedale Date: Fri, 21 Feb 2014 20:59:50 +1000 Subject: [PATCH] fix errors due to use of unportable == operator The `==` operator is not defined by POSIX and many test(1) (also spelled `[`) implementations do not support it. Replace uses of `==` with the POSIX-conformant `=` equality operator. --- install-gitless.sh | 4 ++-- nvm.sh | 2 +- ... deactivate\" should unset the nvm environment variables." | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install-gitless.sh b/install-gitless.sh index d2ee6e6..b5313c8 100755 --- a/install-gitless.sh +++ b/install-gitless.sh @@ -5,11 +5,11 @@ function fatalExit (){ } # an alternative URL that could be used: https://github.com/creationix/nvm/tarball/master -if [ "$NVM_SOURCE" == "" ]; then +if [ "$NVM_SOURCE" = "" ]; then NVM_SOURCE="https://raw.github.com/creationix/nvm/master/nvm.sh" fi -if [ "$NVM_DIR" == "" ]; then +if [ "$NVM_DIR" = "" ]; then NVM_DIR="$HOME/.nvm" fi diff --git a/nvm.sh b/nvm.sh index 8455c69..8df39bb 100755 --- a/nvm.sh +++ b/nvm.sh @@ -351,7 +351,7 @@ nvm() { ;; "uninstall" ) [ $# -ne 2 ] && nvm help && return - if [ $2 == `nvm_version` ]; then + if [ "$2" = `nvm_version` ]; then echo "nvm: Cannot uninstall currently-active node version, $2." return 1 fi diff --git "a/test/fast/Running \"nvm deactivate\" should unset the nvm environment variables." "b/test/fast/Running \"nvm deactivate\" should unset the nvm environment variables." index 813f226..e112709 100755 --- "a/test/fast/Running \"nvm deactivate\" should unset the nvm environment variables." +++ "b/test/fast/Running \"nvm deactivate\" should unset the nvm environment variables." @@ -4,7 +4,7 @@ mkdir -p ../../v0.2.3 die () { echo $@ ; exit 1; } -[ `expr $PATH : ".*v0.2.3/.*/bin"` == 0 ] || echo "WARNING: Unexpectedly found v0.2.3 already active" >&2 +[ `expr $PATH : ".*v0.2.3/.*/bin"` = 0 ] || echo "WARNING: Unexpectedly found v0.2.3 already active" >&2 . ../../nvm.sh nvm use v0.2.3 &&