@@ -242,11 +242,8 @@ const path_1 = __importDefault(__nccwpck_require__(1017));
242
242
const os_1 = __importDefault(__nccwpck_require__(2037));
243
243
const semver_1 = __importDefault(__nccwpck_require__(5911));
244
244
const utils_1 = __nccwpck_require__(918);
245
- var DotnetInstallerLimits;
246
- (function (DotnetInstallerLimits) {
247
- DotnetInstallerLimits[DotnetInstallerLimits["QualityInputMinimalMajorTag"] = 6] = "QualityInputMinimalMajorTag";
248
- DotnetInstallerLimits[DotnetInstallerLimits["LatestPatchSyntaxMinimalMajorTag"] = 5] = "LatestPatchSyntaxMinimalMajorTag";
249
- })(DotnetInstallerLimits || (DotnetInstallerLimits = {}));
245
+ const QUALITY_INPUT_MINIMAL_MAJOR_TAG = 6;
246
+ const LATEST_PATCH_SYNTAX_MINIMAL_MAJOR_TAG = 5;
250
247
class DotnetVersionResolver {
251
248
constructor(version) {
252
249
this.inputVersion = version.trim();
@@ -272,8 +269,7 @@ class DotnetVersionResolver {
272
269
var _b, _c;
273
270
const majorTag = (_c = (_b = this.inputVersion.match(/^(?<majorTag>\d+)\.\d+\.\d{1}x{2}$/)) === null || _b === void 0 ? void 0 : _b.groups) === null || _c === void 0 ? void 0 : _c.majorTag;
274
271
if (majorTag &&
275
- parseInt(majorTag) <
276
- DotnetInstallerLimits.LatestPatchSyntaxMinimalMajorTag) {
272
+ parseInt(majorTag) < LATEST_PATCH_SYNTAX_MINIMAL_MAJOR_TAG) {
277
273
throw new Error(`The 'dotnet-version' was supplied in invalid format: ${this.inputVersion}! The A.B.Cxx syntax is available since the .NET 5.0 release.`);
278
274
}
279
275
return majorTag ? true : false;
@@ -300,9 +296,7 @@ class DotnetVersionResolver {
300
296
this.resolvedArgument.value = 'LTS';
301
297
}
302
298
this.resolvedArgument.qualityFlag =
303
- parseInt(major) >= DotnetInstallerLimits.QualityInputMinimalMajorTag
304
- ? true
305
- : false;
299
+ parseInt(major) >= QUALITY_INPUT_MINIMAL_MAJOR_TAG ? true : false;
306
300
});
307
301
}
308
302
createDotNetVersion() {
@@ -556,7 +550,7 @@ function run() {
556
550
versions.push(getVersionFromGlobalJson(globalJsonPath));
557
551
}
558
552
else {
559
- core.info(`A global.json wasn't found in the root directory. No .NET version will be installed.`);
553
+ core.info(`The global.json wasn't found in the root directory. No .NET version will be installed.`);
560
554
}
561
555
}
562
556
if (versions.length) {
@@ -613,7 +607,7 @@ function outputInstalledVersion(installedVersions, globalJsonFileInput) {
613
607
return;
614
608
}
615
609
if (globalJsonFileInput) {
616
- const versionToOutput = installedVersions.at(-1);
610
+ const versionToOutput = installedVersions.at(-1); // .NET SDK version parsed from the global.json file is installed last
617
611
core.setOutput('dotnet-version', versionToOutput);
618
612
return;
619
613
}
0 commit comments