mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 01:45:50 +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 | ||||
|   fi | ||||
|   # 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" | ||||
|   else | ||||
|     VERSIONS=`find "$NVM_DIR/" -maxdepth 1 -type d -name "v$PATTERN*" -exec basename '{}' ';' \ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user