mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 18:25:52 +08:00 
			
		
		
		
	changed the function to place the curl requirement where it belongs
This commit is contained in:
		
							
								
								
									
										10
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -69,11 +69,6 @@ print_versions() | |||||||
|  |  | ||||||
| nvm() | nvm() | ||||||
| { | { | ||||||
|   if [ ! `which curl` ]; then |  | ||||||
|     echo 'NVM Needs curl to proceed.' >&2; |  | ||||||
|     return |  | ||||||
|   fi |  | ||||||
|  |  | ||||||
|   if [ $# -lt 1 ]; then |   if [ $# -lt 1 ]; then | ||||||
|     nvm help |     nvm help | ||||||
|     return |     return | ||||||
| @@ -105,11 +100,14 @@ nvm() | |||||||
|       echo |       echo | ||||||
|     ;; |     ;; | ||||||
|     "install" ) |     "install" ) | ||||||
|  |       if [ ! `which curl` ]; then | ||||||
|  |         echo 'NVM Needs curl to proceed.' >&2; | ||||||
|  |       fi | ||||||
|  |        | ||||||
|       if [ $# -ne 2 ]; then |       if [ $# -ne 2 ]; then | ||||||
|         nvm help |         nvm help | ||||||
|         return |         return | ||||||
|       fi |       fi | ||||||
|       [ "$NOCURL" ] && curl && return |  | ||||||
|       VERSION=`nvm_version $2` |       VERSION=`nvm_version $2` | ||||||
|  |  | ||||||
|       [ -d "$NVM_DIR/$VERSION" ] && echo "$VERSION is already installed." && return |       [ -d "$NVM_DIR/$VERSION" ] && echo "$VERSION is already installed." && return | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user