mirror of
				https://github.com/actions/setup-node.git
				synced 2025-10-31 16:14:00 +08:00 
			
		
		
		
	bugfix: Don't attempt to use Windows fallbacks on non-Windows OSes (#718)
This commit is contained in:
		| @@ -127,8 +127,12 @@ export default abstract class BaseDistribution { | ||||
|     try { | ||||
|       downloadPath = await tc.downloadTool(info.downloadUrl); | ||||
|     } catch (err) { | ||||
|       if (err instanceof tc.HTTPError && err.httpStatusCode == 404) { | ||||
|         return await this.acquireNodeFromFallbackLocation( | ||||
|       if ( | ||||
|         err instanceof tc.HTTPError && | ||||
|         err.httpStatusCode == 404 && | ||||
|         this.osPlat == 'win32' | ||||
|       ) { | ||||
|         return await this.acquireWindowsNodeFromFallbackLocation( | ||||
|           info.resolvedVersion, | ||||
|           info.arch | ||||
|         ); | ||||
| @@ -151,7 +155,7 @@ export default abstract class BaseDistribution { | ||||
|     return {range: valid, options}; | ||||
|   } | ||||
|  | ||||
|   protected async acquireNodeFromFallbackLocation( | ||||
|   protected async acquireWindowsNodeFromFallbackLocation( | ||||
|     version: string, | ||||
|     arch: string = os.arch() | ||||
|   ): Promise<string> { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Adam Jones
					Adam Jones