This commit is contained in:
Aparna Jyothi 2025-01-30 17:29:09 +05:30
parent 01498de30c
commit 50efbd2a86
2 changed files with 9 additions and 7 deletions

6
dist/setup/index.js vendored
View File

@ -100205,7 +100205,7 @@ class BaseDistribution {
if (err instanceof tc.HTTPError && if (err instanceof tc.HTTPError &&
err.httpStatusCode == 404 && err.httpStatusCode == 404 &&
this.osPlat == 'win32') { this.osPlat == 'win32') {
return yield this.acquireWindowsNodeFromFallbackLocation(info.resolvedVersion, info.arch); return yield this.acquireWindowsNodeFromFallbackLocation(info.resolvedVersion, info.arch, info.downloadUrl);
} }
core.error(`Download failed from ${info.downloadUrl}. Please check the URl and try again.`); core.error(`Download failed from ${info.downloadUrl}. Please check the URl and try again.`);
throw err; throw err;
@ -100223,7 +100223,7 @@ class BaseDistribution {
return { range: valid, options }; return { range: valid, options };
} }
acquireWindowsNodeFromFallbackLocation(version_1) { acquireWindowsNodeFromFallbackLocation(version_1) {
return __awaiter(this, arguments, void 0, function* (version, arch = os_1.default.arch()) { return __awaiter(this, arguments, void 0, function* (version, arch = os_1.default.arch(), downloadUrl) {
const initialUrl = this.getDistributionUrl(); const initialUrl = this.getDistributionUrl();
core.info('url: ' + initialUrl); core.info('url: ' + initialUrl);
const osArch = this.translateArchToDistUrl(arch); const osArch = this.translateArchToDistUrl(arch);
@ -100239,7 +100239,7 @@ class BaseDistribution {
exeUrl = `${initialUrl}/v${version}/win-${osArch}/node.exe`; exeUrl = `${initialUrl}/v${version}/win-${osArch}/node.exe`;
libUrl = `${initialUrl}/v${version}/win-${osArch}/node.lib`; libUrl = `${initialUrl}/v${version}/win-${osArch}/node.lib`;
core.info(`Downloading only node binary from ${exeUrl}`); core.info(`Downloading only node binary from ${exeUrl}`);
if (!exeUrl) { if (downloadUrl != exeUrl) {
core.error('unable to download node binary with the provided URL. Please check and try again'); core.error('unable to download node binary with the provided URL. Please check and try again');
} }
const exePath = yield tc.downloadTool(exeUrl); const exePath = yield tc.downloadTool(exeUrl);

View File

@ -169,7 +169,8 @@ export default abstract class BaseDistribution {
) { ) {
return await this.acquireWindowsNodeFromFallbackLocation( return await this.acquireWindowsNodeFromFallbackLocation(
info.resolvedVersion, info.resolvedVersion,
info.arch info.arch,
info.downloadUrl
); );
} }
core.error(`Download failed from ${info.downloadUrl}. Please check the URl and try again.`); core.error(`Download failed from ${info.downloadUrl}. Please check the URl and try again.`);
@ -193,11 +194,12 @@ export default abstract class BaseDistribution {
protected async acquireWindowsNodeFromFallbackLocation( protected async acquireWindowsNodeFromFallbackLocation(
version: string, version: string,
arch: string = os.arch() arch: string = os.arch(),
downloadUrl : string
): Promise<string> { ): Promise<string> {
const initialUrl = this.getDistributionUrl(); const initialUrl = this.getDistributionUrl();
core.info('url: ' + initialUrl); core.info('url: ' + initialUrl);
const osArch: string = this.translateArchToDistUrl(arch); const osArch: string = this.translateArchToDistUrl(arch);
// Create temporary folder to download to // Create temporary folder to download to
const tempDownloadFolder = `temp_${uuidv4()}`; const tempDownloadFolder = `temp_${uuidv4()}`;
@ -212,7 +214,7 @@ export default abstract class BaseDistribution {
libUrl = `${initialUrl}/v${version}/win-${osArch}/node.lib`; libUrl = `${initialUrl}/v${version}/win-${osArch}/node.lib`;
core.info(`Downloading only node binary from ${exeUrl}`); core.info(`Downloading only node binary from ${exeUrl}`);
if(!exeUrl ){core.error('unable to download node binary with the provided URL. Please check and try again');} if(downloadUrl != exeUrl ){core.error('unable to download node binary with the provided URL. Please check and try again');}
const exePath = await tc.downloadTool(exeUrl); const exePath = await tc.downloadTool(exeUrl);