mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-20 13:14:44 +00:00
bugfix: Don't attempt to use Windows fallbacks on non-Windows OSes (#718)
This commit is contained in:
parent
9d255ef245
commit
d98fa11138
4 changed files with 1419 additions and 1324 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue