mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-11-01 02:35:51 +08:00 
			
		
		
		
	fixup automatically prepending the v for remote requests
This commit is contained in:
		
							
								
								
									
										7
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -37,7 +37,7 @@ nvm_remote_version() | |||||||
| { | { | ||||||
|     PATTERN=$1 |     PATTERN=$1 | ||||||
|     VERSION=`nvm_ls_remote $PATTERN | tail -n1` |     VERSION=`nvm_ls_remote $PATTERN | tail -n1` | ||||||
|     echo "v$VERSION" |     echo "$VERSION" | ||||||
|  |  | ||||||
|     if [ "$VERSION" = 'N/A' ]; then |     if [ "$VERSION" = 'N/A' ]; then | ||||||
|         return |         return | ||||||
| @@ -74,6 +74,11 @@ nvm_ls() | |||||||
| nvm_ls_remote() | nvm_ls_remote() | ||||||
| { | { | ||||||
|     PATTERN=$1 |     PATTERN=$1 | ||||||
|  |     if [ "$PATTERN" ]; then | ||||||
|  |         if [ "${PATTERN:0:1}" != "v" ]; then | ||||||
|  |             PATTERN=v$PATTERN | ||||||
|  |         fi | ||||||
|  |     fi | ||||||
|     VERSIONS=`curl -s http://nodejs.org/dist/ \ |     VERSIONS=`curl -s http://nodejs.org/dist/ \ | ||||||
|             | egrep -o 'v[0-9]+\.[0-9]+\.[0-9]+' \ |             | egrep -o 'v[0-9]+\.[0-9]+\.[0-9]+' \ | ||||||
|             | grep -w "${PATTERN}" \ |             | grep -w "${PATTERN}" \ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user