mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	Fixing nvm ls 0.x to only include 0.x.* instead of 0.x*.*
				
					
				
			This commit is contained in:
		
							
								
								
									
										6
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -158,7 +158,11 @@ nvm_ls() { | |||||||
|       VERSIONS="$PATTERN" |       VERSIONS="$PATTERN" | ||||||
|     fi |     fi | ||||||
|   else |   else | ||||||
|     VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "$(nvm_format_version $PATTERN)*" -exec basename '{}' ';' \ |     PATTERN=$(nvm_format_version $PATTERN) | ||||||
|  |     if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then | ||||||
|  |       PATTERN="$PATTERN." | ||||||
|  |     fi | ||||||
|  |     VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "$PATTERN*" -exec basename '{}' ';' \ | ||||||
|       | sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.'` |       | sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | \grep -v '^ *\.'` | ||||||
|   fi |   fi | ||||||
|   if [ -z "$VERSIONS" ]; then |   if [ -z "$VERSIONS" ]; then | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user