mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	Only list extant explicit version
This commit is contained in:
		
							
								
								
									
										4
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -130,7 +130,9 @@ nvm_ls() { | ||||
|   fi | ||||
|   # If it looks like an explicit version, don't do anything funny | ||||
|   if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then | ||||
|     VERSIONS="$PATTERN" | ||||
|     if [ -d "$NVM_DIR/$PATTERN" ]; then | ||||
|       VERSIONS="$PATTERN" | ||||
|     fi | ||||
|   else | ||||
|     VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "$(nvm_format_version $PATTERN)*" -exec basename '{}' ';' \ | ||||
|       | sort -t. -u -k 1.2,1n -k 2,2n -k 3,3n | grep -v '^ *\.'` | ||||
|   | ||||
		Reference in New Issue
	
	Block a user