mirror of
				https://github.com/actions/setup-node.git
				synced 2025-10-31 16:14:00 +08:00 
			
		
		
		
	Add support for asdf format as Node.js version file
This commit is contained in:
		| @@ -487,12 +487,16 @@ function translateArchToDistUrl(arch: string): string { | ||||
| } | ||||
|  | ||||
| export function parseNodeVersionFile(contents: string): string { | ||||
|   let nodeVersion = contents.trim(); | ||||
|   const found = contents.match(/^(?:nodejs\s+)?v?(?<version>[^\s]+)$/m); | ||||
|   const nodeVersion = found?.groups?.version; | ||||
|  | ||||
|   if (/^v\d/.test(nodeVersion)) { | ||||
|     nodeVersion = nodeVersion.substring(1); | ||||
|   if (nodeVersion) { | ||||
|     return nodeVersion; | ||||
|   } | ||||
|   return nodeVersion; | ||||
|  | ||||
|   // In the case of an unknown format, | ||||
|   // return as is and evaluate the version separately. | ||||
|   return contents.trim(); | ||||
| } | ||||
|  | ||||
| function isLatestSyntax(versionSpec): boolean { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Hideki Igarashi
					Hideki Igarashi