Make version parsing always work for extended runtime versions

This commit is contained in:
Noah Gilson 2024-02-21 14:38:54 -08:00
Родитель 720f316370
Коммит b4e5ea63af
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -135,7 +135,13 @@ export class VersionResolver implements IVersionResolver {
Debugging.log(`Resolving the version: ${version}`, this.context.eventStream);
this.validateVersionInput(version);
const matchingVersion = releases.filter((availableVersions : IDotnetVersion) => availableVersions.channelVersion === version);
// Search for the specific version
let matchingVersion = releases.filter((availableVersions : IDotnetVersion) => availableVersions.version === version);
// If a x.y version is given, just find that instead (which is how almost all requests are given atm)
if(!matchingVersion || matchingVersion.length < 1)
{
matchingVersion = releases.filter((availableVersions : IDotnetVersion) => availableVersions.channelVersion === version);
}
if (!matchingVersion || matchingVersion.length < 1)
{
const err = new DotnetVersionResolutionError(new Error(`The requested and or resolved version is invalid.`), version);