bugfix: Don't attempt to use Windows fallbacks on non-Windows OSes

This commit is contained in:
Adam Jones 2023-03-15 20:31:47 +00:00
parent a4fcaaf314
commit 57b2336da3
No known key found for this signature in database
GPG key ID: B3D3399C05B09A00

View file

@ -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> {