mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-08-18 14:45:09 +00:00
Refactor code
This commit is contained in:
parent
75d47e04fb
commit
b74b8e018a
7
dist/index.js
vendored
7
dist/index.js
vendored
@ -484,12 +484,11 @@ function run() {
|
|||||||
auth.configAuthentication(sourceUrl, configFile);
|
auth.configAuthentication(sourceUrl, configFile);
|
||||||
}
|
}
|
||||||
const comparisonRange = globalJsonFileInput
|
const comparisonRange = globalJsonFileInput
|
||||||
? versions.at(-1)
|
? versions[versions.length - 1]
|
||||||
: '*';
|
: '*';
|
||||||
const includePrereleaseOption = {
|
const versionToOutput = semver_1.default.maxSatisfying(installedDotnetVersions, comparisonRange, {
|
||||||
includePrerelease: true
|
includePrerelease: true
|
||||||
};
|
});
|
||||||
const versionToOutput = semver_1.default.maxSatisfying(installedDotnetVersions, comparisonRange, includePrereleaseOption);
|
|
||||||
core.setOutput('dotnet-version', versionToOutput);
|
core.setOutput('dotnet-version', versionToOutput);
|
||||||
const matchersPath = path_1.default.join(__dirname, '..', '.github');
|
const matchersPath = path_1.default.join(__dirname, '..', '.github');
|
||||||
core.info(`##[add-matcher]${path_1.default.join(matchersPath, 'csc.json')}`);
|
core.info(`##[add-matcher]${path_1.default.join(matchersPath, 'csc.json')}`);
|
||||||
|
@ -75,17 +75,15 @@ export async function run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const comparisonRange: string = globalJsonFileInput
|
const comparisonRange: string = globalJsonFileInput
|
||||||
? versions.at(-1)!
|
? versions[versions.length - 1]!
|
||||||
: '*';
|
: '*';
|
||||||
|
|
||||||
const includePrereleaseOption = {
|
|
||||||
includePrerelease: true
|
|
||||||
};
|
|
||||||
|
|
||||||
const versionToOutput = semver.maxSatisfying(
|
const versionToOutput = semver.maxSatisfying(
|
||||||
installedDotnetVersions,
|
installedDotnetVersions,
|
||||||
comparisonRange,
|
comparisonRange,
|
||||||
includePrereleaseOption
|
{
|
||||||
|
includePrerelease: true
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
core.setOutput('dotnet-version', versionToOutput);
|
core.setOutput('dotnet-version', versionToOutput);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user