mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-02-18 22:12:48 -05:00
fix
This commit is contained in:
parent
f40797d717
commit
7e57948fe0
3 changed files with 11 additions and 15 deletions
11
dist/setup/index.js
vendored
11
dist/setup/index.js
vendored
|
@ -100156,7 +100156,7 @@ class BaseDistribution {
|
|||
}
|
||||
getMirrorUrlVersions() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const initialUrl = this.getDistributionMirrorUrl();
|
||||
const initialUrl = this.getDistributionUrl();
|
||||
const dataUrl = `${initialUrl}/index.json`;
|
||||
const response = yield this.httpClient.getJson(dataUrl);
|
||||
return response.result || [];
|
||||
|
@ -100173,7 +100173,7 @@ class BaseDistribution {
|
|||
? `${fileName}.zip`
|
||||
: `${fileName}.7z`
|
||||
: `${fileName}.tar.gz`;
|
||||
const initialUrl = this.getDistributionMirrorUrl();
|
||||
const initialUrl = this.getDistributionUrl();
|
||||
const url = `${initialUrl}/v${version}/${urlFileName}`;
|
||||
return {
|
||||
downloadUrl: url,
|
||||
|
@ -100647,12 +100647,11 @@ class OfficialBuilds extends base_distribution_1.default {
|
|||
return version;
|
||||
}
|
||||
getDistributionUrl() {
|
||||
if (this.nodeInfo.mirrorURL) {
|
||||
return this.nodeInfo.mirrorURL;
|
||||
}
|
||||
return `https://nodejs.org/dist`;
|
||||
}
|
||||
getDistributionMirrorUrl() {
|
||||
const mirrorURL = this.nodeInfo.mirrorURL;
|
||||
return mirrorURL !== null && mirrorURL !== void 0 ? mirrorURL : '';
|
||||
}
|
||||
getManifest() {
|
||||
core.debug('Getting manifest from actions/node-versions@main');
|
||||
return tc.getManifestFromRepo('actions', 'node-versions', this.nodeInfo.auth, 'main');
|
||||
|
|
|
@ -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
Reference in a new issue