mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	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.
This commit is contained in:
		| @@ -5,11 +5,11 @@ function fatalExit (){ | |||||||
| } | } | ||||||
|  |  | ||||||
| # an alternative URL that could be used: https://github.com/creationix/nvm/tarball/master | # 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" |     NVM_SOURCE="https://raw.github.com/creationix/nvm/master/nvm.sh" | ||||||
| fi | fi | ||||||
|  |  | ||||||
| if [ "$NVM_DIR" == "" ]; then | if [ "$NVM_DIR" = "" ]; then | ||||||
|     NVM_DIR="$HOME/.nvm" |     NVM_DIR="$HOME/.nvm" | ||||||
| fi | fi | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -351,7 +351,7 @@ nvm() { | |||||||
|     ;; |     ;; | ||||||
|     "uninstall" ) |     "uninstall" ) | ||||||
|       [ $# -ne 2 ] && nvm help && return |       [ $# -ne 2 ] && nvm help && return | ||||||
|       if [ $2 == `nvm_version` ]; then |       if [ "$2" = `nvm_version` ]; then | ||||||
|         echo "nvm: Cannot uninstall currently-active node version, $2." |         echo "nvm: Cannot uninstall currently-active node version, $2." | ||||||
|         return 1 |         return 1 | ||||||
|       fi |       fi | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ mkdir -p ../../v0.2.3 | |||||||
|  |  | ||||||
| die () { echo $@ ; exit 1; } | 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.sh | ||||||
| nvm use v0.2.3 && | nvm use v0.2.3 && | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user