mirror-url -implementation

This commit is contained in:
Aparna Jyothi
2025-02-19 19:10:42 +05:30
parent 802632921f
commit 1b0ef2d227
13 changed files with 1223 additions and 184 deletions

View File

@@ -1,12 +1,30 @@
import BaseDistribution from '../base-distribution';
import {NodeInputs} from '../base-models';
import * as core from '@actions/core';
export default class RcBuild extends BaseDistribution {
getDistributionMirrorUrl() {
throw new Error('Method not implemented.');
}
constructor(nodeInfo: NodeInputs) {
super(nodeInfo);
}
getDistributionUrl(): string {
return 'https://nodejs.org/download/rc';
protected getDistributionUrl(): string {
if (this.nodeInfo.mirrorURL) {
if (this.nodeInfo.mirrorURL != '') {
return this.nodeInfo.mirrorURL;
} else {
if (this.nodeInfo.mirrorURL === '') {
throw new Error(
'Mirror URL is empty. Please provide a valid mirror URL.'
);
} else {
throw new Error('Mirror URL is not a valid');
}
}
} else {
return 'https://nodejs.org/download/rc';
}
}
}