mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 18:25:52 +08:00 
			
		
		
		
	Naming install.sh functions more explicitly as being for nvm.
				
					
				
			This commit is contained in:
		
							
								
								
									
										12
									
								
								install.sh
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								install.sh
									
									
									
									
									
								
							| @@ -23,7 +23,7 @@ if ! nvm_has "curl"; then | |||||||
|   fi |   fi | ||||||
| fi | fi | ||||||
|  |  | ||||||
| install_from_git() { | install_nvm_from_git() { | ||||||
|   if [ -z "$NVM_SOURCE" ]; then |   if [ -z "$NVM_SOURCE" ]; then | ||||||
|     NVM_SOURCE="https://github.com/creationix/nvm.git" |     NVM_SOURCE="https://github.com/creationix/nvm.git" | ||||||
|   fi |   fi | ||||||
| @@ -43,7 +43,7 @@ install_from_git() { | |||||||
|   fi |   fi | ||||||
| } | } | ||||||
|  |  | ||||||
| install_as_script() { | install_nvm_as_script() { | ||||||
|   if [ -z "$NVM_SOURCE" ]; then |   if [ -z "$NVM_SOURCE" ]; then | ||||||
|     NVM_SOURCE="https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh" |     NVM_SOURCE="https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh" | ||||||
|   fi |   fi | ||||||
| @@ -64,9 +64,9 @@ install_as_script() { | |||||||
| if [ -z "$METHOD" ]; then | if [ -z "$METHOD" ]; then | ||||||
|   # Autodetect install method |   # Autodetect install method | ||||||
|   if nvm_has "git"; then |   if nvm_has "git"; then | ||||||
|     install_from_git |     install_nvm_from_git | ||||||
|   elif nvm_has "curl"; then |   elif nvm_has "curl"; then | ||||||
|     install_as_script |     install_nvm_as_script | ||||||
|   else |   else | ||||||
|     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 | ||||||
| @@ -77,14 +77,14 @@ else | |||||||
|       echo >&2 "You need git to install nvm" |       echo >&2 "You need git to install nvm" | ||||||
|       exit 1 |       exit 1 | ||||||
|     fi |     fi | ||||||
|     install_from_git |     install_nvm_from_git | ||||||
|   fi |   fi | ||||||
|   if [ "$METHOD" = "script" ]; then |   if [ "$METHOD" = "script" ]; then | ||||||
|     if ! nvm_has "curl"; then |     if ! nvm_has "curl"; then | ||||||
|       echo >&2 "You need curl or wget to install nvm" |       echo >&2 "You need curl or wget to install nvm" | ||||||
|       exit 1 |       exit 1 | ||||||
|     fi |     fi | ||||||
|     install_as_script |     install_nvm_as_script | ||||||
|   fi |   fi | ||||||
| fi | fi | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user