mirror of
https://github.com/actions/setup-node.git
synced 2026-02-20 05:24:47 +08:00
mirror-url -implementation
This commit is contained in:
@@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user