mirror of
				https://github.com/shivammathur/setup-php.git
				synced 2025-10-31 15:26:23 +07:00 
			
		
		
		
	Adjust filtered composer version
This commit is contained in:
		 Michele Locati
					Michele Locati
				
			
				
					committed by
					
						 Shivam Mathur
						Shivam Mathur
					
				
			
			
				
	
			
			
			 Shivam Mathur
						Shivam Mathur
					
				
			
						parent
						
							48f537d6d0
						
					
				
				
					commit
					5c4074b01a
				
			| @ -282,7 +282,7 @@ export async function getSymfonyUri( | ||||
|  */ | ||||
| export async function addComposer(tools_list: string[]): Promise<string[]> { | ||||
|   const regex_any = /^composer($|:.*)/; | ||||
|   const regex_valid = /^composer:?($|preview$|snapshot$|v?[1-2]$)/; | ||||
|   const regex_valid = /^composer:?($|preview$|snapshot$|v?[1-2]$|v?\d+\.\d+\.\d+[\w-]*$)/; | ||||
|   const regex_composer1_tools = /hirak|prestissimo|narrowspark|composer-prefetcher/; | ||||
|   const matches: string[] = tools_list.filter(tool => regex_valid.test(tool)); | ||||
|   let composer = 'composer'; | ||||
| @ -294,7 +294,7 @@ export async function addComposer(tools_list: string[]): Promise<string[]> { | ||||
|     case matches[0] == undefined: | ||||
|       break; | ||||
|     default: | ||||
|       composer = matches[matches.length - 1].replace(/v([1-2])/, '$1'); | ||||
|       composer = matches[matches.length - 1].replace(/v(\d\S*)/, '$1'); | ||||
|       break; | ||||
|   } | ||||
|   tools_list.unshift(composer); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user