mirror of
https://github.com/actions/setup-node.git
synced 2025-06-29 22:23:47 +00:00
fix
This commit is contained in:
parent
f40797d717
commit
7e57948fe0
3 changed files with 11 additions and 15 deletions
|
@ -25,7 +25,6 @@ export default abstract class BaseDistribution {
|
|||
}
|
||||
|
||||
protected abstract getDistributionUrl(): string;
|
||||
protected abstract getDistributionMirrorUrl(): string;
|
||||
|
||||
public async setupNodeJs() {
|
||||
let nodeJsVersions: INodeVersion[] | undefined;
|
||||
|
@ -106,7 +105,7 @@ export default abstract class BaseDistribution {
|
|||
}
|
||||
|
||||
protected async getMirrorUrlVersions(): Promise<INodeVersion[]> {
|
||||
const initialUrl = this.getDistributionMirrorUrl();
|
||||
const initialUrl = this.getDistributionUrl();
|
||||
|
||||
const dataUrl = `${initialUrl}/index.json`;
|
||||
|
||||
|
@ -127,7 +126,7 @@ export default abstract class BaseDistribution {
|
|||
? `${fileName}.zip`
|
||||
: `${fileName}.7z`
|
||||
: `${fileName}.tar.gz`;
|
||||
const initialUrl = this.getDistributionMirrorUrl();
|
||||
const initialUrl = this.getDistributionUrl();
|
||||
const url = `${initialUrl}/v${version}/${urlFileName}`;
|
||||
|
||||
return <INodeVersionInfo>{
|
||||
|
|
|
@ -193,14 +193,12 @@ export default class OfficialBuilds extends BaseDistribution {
|
|||
}
|
||||
|
||||
protected getDistributionUrl(): string {
|
||||
if (this.nodeInfo.mirrorURL) {
|
||||
return this.nodeInfo.mirrorURL;
|
||||
}
|
||||
return `https://nodejs.org/dist`;
|
||||
}
|
||||
|
||||
protected getDistributionMirrorUrl(): string {
|
||||
const mirrorURL = this.nodeInfo.mirrorURL;
|
||||
|
||||
return mirrorURL ?? '';
|
||||
}
|
||||
|
||||
|
||||
private getManifest(): Promise<tc.IToolRelease[]> {
|
||||
core.debug('Getting manifest from actions/node-versions@main');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue