mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 01:45:50 +08:00 
			
		
		
		
	Use [0-9] instead of [[:digit:]] per https://github.com/creationix/nvm/pull/466#discussion_r14853668 - it's simpler (and probably more portable).
This commit is contained in:
		
							
								
								
									
										4
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -153,13 +153,13 @@ nvm_ls() { | ||||
|     return | ||||
|   fi | ||||
|   # If it looks like an explicit version, don't do anything funny | ||||
|   if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then | ||||
|   if [ `expr "$PATTERN" : "v[0-9]*\.[0-9]*\.[0-9]*$"` != 0 ]; then | ||||
|     if [ -d "$NVM_DIR/$PATTERN" ]; then | ||||
|       VERSIONS="$PATTERN" | ||||
|     fi | ||||
|   else | ||||
|     PATTERN=$(nvm_format_version $PATTERN) | ||||
|     if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then | ||||
|     if [ `expr "$PATTERN" : "v[0-9]*\.[0-9]*$"` != 0 ]; then | ||||
|       PATTERN="$PATTERN." | ||||
|     fi | ||||
|     VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "$PATTERN*" -exec basename '{}' ';' \ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user