mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	Collapsing some if/else conditions with elif
This commit is contained in:
		
							
								
								
									
										23
									
								
								install.sh
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								install.sh
									
									
									
									
									
								
							| @@ -75,21 +75,18 @@ if [ -z "$METHOD" ]; then | |||||||
|     echo >&2 "You need git, curl, or wget to install nvm" |     echo >&2 "You need git, curl, or wget to install nvm" | ||||||
|     exit 1 |     exit 1 | ||||||
|   fi |   fi | ||||||
| else | elif [ "~$METHOD" = "~git" ]; then | ||||||
|   if [ "~$METHOD" = "~git" ]; then |   if ! nvm_has "git"; then | ||||||
|     if ! nvm_has "git"; then |     echo >&2 "You need git to install nvm" | ||||||
|       echo >&2 "You need git to install nvm" |     exit 1 | ||||||
|       exit 1 |  | ||||||
|     fi |  | ||||||
|     install_nvm_from_git |  | ||||||
|   fi |   fi | ||||||
|   if [ "~$METHOD" = "~script" ]; then |   install_nvm_from_git | ||||||
|     if ! nvm_has "nvm_download"; then | elif [ "~$METHOD" = "~script" ]; then | ||||||
|       echo >&2 "You need curl or wget to install nvm" |   if ! nvm_has "nvm_download"; then | ||||||
|       exit 1 |     echo >&2 "You need curl or wget to install nvm" | ||||||
|     fi |     exit 1 | ||||||
|     install_nvm_as_script |  | ||||||
|   fi |   fi | ||||||
|  |   install_nvm_as_script | ||||||
| fi | fi | ||||||
|  |  | ||||||
| echo | echo | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user