mirror of
https://github.com/actions/setup-node.git
synced 2026-02-27 01:34:43 +08:00
mirror-url -implementation
This commit is contained in:
@@ -1,13 +1,29 @@
|
||||
import BasePrereleaseNodejs from '../base-distribution-prerelease';
|
||||
import {NodeInputs} from '../base-models';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
export default class NightlyNodejs extends BasePrereleaseNodejs {
|
||||
protected distribution = 'nightly';
|
||||
|
||||
constructor(nodeInfo: NodeInputs) {
|
||||
super(nodeInfo);
|
||||
}
|
||||
|
||||
protected getDistributionUrl(): string {
|
||||
return 'https://nodejs.org/download/nightly';
|
||||
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/nightly';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user