Refactor code
This commit is contained in:
parent
75d47e04fb
commit
b74b8e018a
|
@ -484,12 +484,11 @@ function run() {
|
|||
auth.configAuthentication(sourceUrl, configFile);
|
||||
}
|
||||
const comparisonRange = globalJsonFileInput
|
||||
? versions.at(-1)
|
||||
? versions[versions.length - 1]
|
||||
: '*';
|
||||
const includePrereleaseOption = {
|
||||
const versionToOutput = semver_1.default.maxSatisfying(installedDotnetVersions, comparisonRange, {
|
||||
includePrerelease: true
|
||||
};
|
||||
const versionToOutput = semver_1.default.maxSatisfying(installedDotnetVersions, comparisonRange, includePrereleaseOption);
|
||||
});
|
||||
core.setOutput('dotnet-version', versionToOutput);
|
||||
const matchersPath = path_1.default.join(__dirname, '..', '.github');
|
||||
core.info(`##[add-matcher]${path_1.default.join(matchersPath, 'csc.json')}`);
|
||||
|
|
|
@ -75,17 +75,15 @@ export async function run() {
|
|||
}
|
||||
|
||||
const comparisonRange: string = globalJsonFileInput
|
||||
? versions.at(-1)!
|
||||
? versions[versions.length - 1]!
|
||||
: '*';
|
||||
|
||||
const includePrereleaseOption = {
|
||||
includePrerelease: true
|
||||
};
|
||||
|
||||
const versionToOutput = semver.maxSatisfying(
|
||||
installedDotnetVersions,
|
||||
comparisonRange,
|
||||
includePrereleaseOption
|
||||
{
|
||||
includePrerelease: true
|
||||
}
|
||||
);
|
||||
|
||||
core.setOutput('dotnet-version', versionToOutput);
|
||||
|
|
Loading…
Reference in New Issue