mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2024-12-24 11:35:48 +00:00
feat: add arch to acquireNodeFromFallbackLocation
This commit is contained in:
parent
bf47decdc2
commit
3eb4bc9d68
1 changed files with 7 additions and 3 deletions
|
@ -107,7 +107,10 @@ export async function getNode(
|
||||||
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) {
|
||||||
return await acquireNodeFromFallbackLocation(info.resolvedVersion);
|
return await acquireNodeFromFallbackLocation(
|
||||||
|
info.resolvedVersion,
|
||||||
|
info.arch
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw err;
|
throw err;
|
||||||
|
@ -317,10 +320,11 @@ export async function getVersionsFromDist(): Promise<INodeVersion[]> {
|
||||||
// Note also that the files are normally zipped but in this case they are just an exe
|
// Note also that the files are normally zipped but in this case they are just an exe
|
||||||
// and lib file in a folder, not zipped.
|
// and lib file in a folder, not zipped.
|
||||||
async function acquireNodeFromFallbackLocation(
|
async function acquireNodeFromFallbackLocation(
|
||||||
version: string
|
version: string,
|
||||||
|
arch: string = os.arch()
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
let osPlat: string = os.platform();
|
let osPlat: string = os.platform();
|
||||||
let osArch: string = translateArchToDistUrl(os.arch());
|
let osArch: string = translateArchToDistUrl(arch);
|
||||||
|
|
||||||
// Create temporary folder to download in to
|
// Create temporary folder to download in to
|
||||||
const tempDownloadFolder: string =
|
const tempDownloadFolder: string =
|
||||||
|
|
Loading…
Reference in a new issue