Skip to content

Commit

Permalink
fix: ignore version if custom url
Browse files Browse the repository at this point in the history
  • Loading branch information
asjdf committed Jul 23, 2024
1 parent 2a66b74 commit 94c9bb7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/distributions/base-distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@ export default abstract class BaseDistribution {
if (toolPath) {
core.info(`Found in cache @ ${toolPath}`);
} else {
const evaluatedVersion = await this.findVersionInDist(nodeJsVersions);
const toolName = this.getNodejsDistInfo(evaluatedVersion);
toolPath = await this.downloadNodejs(toolName);
const customUrl = core.getInput('custom-url');
if (customUrl) {
const toolName = this.getNodejsDistInfo(this.nodeInfo.versionSpec);
toolPath = await this.downloadNodejs(toolName);
} else {
const evaluatedVersion = await this.findVersionInDist(nodeJsVersions);
const toolName = this.getNodejsDistInfo(evaluatedVersion);
toolPath = await this.downloadNodejs(toolName);
}
}

if (this.osPlat != 'win32') {
Expand Down Expand Up @@ -121,7 +127,7 @@ export default abstract class BaseDistribution {
let url = `${initialUrl}/v${version}/${urlFileName}`;

const customUrl = core.getInput('custom-url');
if (customUrl){
if (customUrl) {
url = customUrl;
}

Expand Down

0 comments on commit 94c9bb7

Please sign in to comment.