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