mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 18:25:52 +08:00 
			
		
		
		
	fix explicit version matching on FreeBSD
FreeBSD's regular expression library does not like the pattern used for matching explicit version strings in `nvm_ls`. Change the pattern to something more specific that works on FreeBSD.
This commit is contained in:
		
							
								
								
									
										2
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -93,7 +93,7 @@ nvm_ls() { | |||||||
|     return |     return | ||||||
|   fi |   fi | ||||||
|   # If it looks like an explicit version, don't do anything funny |   # If it looks like an explicit version, don't do anything funny | ||||||
|   if [ `expr "$PATTERN" : "v.*.\?.*.\?.*$"` != 0 ]; then |   if [ `expr "$PATTERN" : "v[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*$"` != 0 ]; then | ||||||
|     VERSIONS="$PATTERN" |     VERSIONS="$PATTERN" | ||||||
|   else |   else | ||||||
|     VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "v$PATTERN*" -exec basename '{}' ';' \ |     VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "v$PATTERN*" -exec basename '{}' ';' \ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user