npm run build

This commit is contained in:
Gregory Mitchell 2024-11-09 02:27:07 +00:00 committed by GitHub
parent 8e2bc8fd07
commit 7e3fee94eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

74
dist/setup/index.js vendored
View File

@ -124535,6 +124535,7 @@ const path_1 = __importDefault(__nccwpck_require__(71017));
const semver_1 = __importDefault(__nccwpck_require__(11383));
const base_installer_1 = __nccwpck_require__(59741);
const util_1 = __nccwpck_require__(92629);
const http_client_1 = __nccwpck_require__(96255);
class JetBrainsDistribution extends base_installer_1.JavaBase {
constructor(installerOptions) {
super('JetBrains', installerOptions);
@ -124557,7 +124558,7 @@ class JetBrainsDistribution extends base_installer_1.JavaBase {
const resolvedFullVersion = satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
if (!resolvedFullVersion) {
const availableOptions = versionsRaw
.map(item => item.tag_name)
.map(item => `${item.tag_name} (${item.semver}+${item.build})`)
.join(', ');
const availableOptionsMessage = availableOptions
? `\nAvailable versions: ${availableOptions}`
@ -124610,44 +124611,75 @@ class JetBrainsDistribution extends base_installer_1.JavaBase {
rawVersions.push(...paginationPage);
page_index++;
}
const versions0 = rawVersions.map(v => {
const versions0 = rawVersions.map((v) => __awaiter(this, void 0, void 0, function* () {
var _a;
// Release tags look like one of these:
// jbr-release-21.0.3b465.3
// jbr17-b87.7
// jb11_0_11-b87.7
// jbr11_0_15b2043.56
// 11_0_11b1536.2
// 11_0_11-b1522
const tag = v.tag_name;
// Extract version string
let vstring;
switch ((_a = tag.match(/-/g)) === null || _a === void 0 ? void 0 : _a.length) {
case 2:
vstring = tag.substring(tag.lastIndexOf('-') + 1);
const vstring = tag
.replace('jbr-release-', '')
.replace('jbr', '')
.replace('jb', '')
.replace('-', '');
const vsplit = vstring.split('b');
let semver = vsplit[0];
const build = +vsplit[1];
// Normalize semver
if (!semver.includes('.') && !semver.includes('_'))
semver = `${semver}.0.0`;
// Construct URL
let type;
switch ((_a = this.packageType) !== null && _a !== void 0 ? _a : '') {
case 'jre':
type = 'jbr';
break;
case 1:
vstring = tag.substring(2).replace(/-/g, '');
case 'jdk+jcef':
type = 'jbrsdk_jcef';
break;
case undefined: // 0
vstring = tag.substring(3);
case 'jre+jcef':
type = 'jbr_jcef';
break;
case 'jdk+ft':
type = 'jbrsdk_ft';
break;
case 'jre+ft':
type = 'jbr_ft';
break;
default:
throw new Error(`Unrecognized tag_name: ${tag}`);
type = 'jbrsdk';
break;
}
const vsplit = vstring.split('b');
const semver = vsplit[0];
const build = +vsplit[1];
// Construct URL
const url = `https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-${semver}-${platform}-${arch}-b${build}.tar.gz`;
return {
let url = `https://cache-redirector.jetbrains.com/intellij-jbr/${type}-${semver}-${platform}-${arch}-b${build}.tar.gz`;
let include = false;
const res = yield this.http.head(url);
if (res.message.statusCode === http_client_1.HttpCodes.OK) {
include = true;
}
else {
url = `https://cache-redirector.jetbrains.com/intellij-jbr/${type}_nomod-${semver}-${platform}-${arch}-b${build}.tar.gz`;
const res2 = yield this.http.head(url);
if (res2.message.statusCode === http_client_1.HttpCodes.OK) {
include = true;
}
}
const version = {
tag_name: tag,
semver: semver.replace(/_/g, '.'),
build: build,
url: url
};
});
const versions = versions0.filter((i) => __awaiter(this, void 0, void 0, function* () {
const res = yield this.http.head(i.url);
return res.message.statusCode === 200;
return {
item: version,
include: include
};
}));
const versions = yield Promise.all(versions0).then(res => res.filter(item => item.include).map(item => item.item));
if (core.isDebug()) {
core.startGroup('Print information about available versions');
console.timeEnd('Retrieving available versions for JBR took'); // eslint-disable-line no-console