mirror of
https://github.com/actions/setup-node.git
synced 2026-05-18 21:30:47 +08:00
mirror-url -implementation
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import BasePrereleaseNodejs from '../base-distribution-prerelease';
|
||||
import {NodeInputs} from '../base-models';
|
||||
|
||||
export default class CanaryBuild extends BasePrereleaseNodejs {
|
||||
protected distribution = 'v8-canary';
|
||||
constructor(nodeInfo: NodeInputs) {
|
||||
@@ -8,6 +7,20 @@ export default class CanaryBuild extends BasePrereleaseNodejs {
|
||||
}
|
||||
|
||||
protected getDistributionUrl(): string {
|
||||
return 'https://nodejs.org/download/v8-canary';
|
||||
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/v8-canary';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user