take only the first match

This commit is contained in:
Artur
2023-03-10 06:21:03 +01:00
parent 89690cc4ff
commit 772be33a48

View File

@@ -23,7 +23,7 @@ export class DotnetTool implements IDotnetTool {
private httpClient: http.HttpClient private httpClient: http.HttpClient
private static readonly nugetRoot: string = private static readonly nugetRoot: string =
'https://api-v2v3search-0.nuget.org/' 'https://azuresearch-usnc.nuget.org/'
constructor( constructor(
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent, @inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
@@ -147,11 +147,9 @@ export class DotnetTool implements IDotnetTool {
} ${includePrerelease ? 'including pre-releases' : ''}` } ${includePrerelease ? 'including pre-releases' : ''}`
) )
const downloadPath = `${ const toolNameParam = encodeURIComponent(toolName.toLowerCase());
DotnetTool.nugetRoot const prereleaseParam = includePrerelease ? 'true' : 'false';
}query?q=${encodeURIComponent(toolName.toLowerCase())}&prerelease=${ const downloadPath = `${DotnetTool.nugetRoot}query?q=${toolNameParam}&prerelease=${prereleaseParam}&semVerLevel=2.0.0&take=1`
includePrerelease ? 'true' : 'false'
}&semVerLevel=2.0.0`
const res = await this.httpClient.get(downloadPath) const res = await this.httpClient.get(downloadPath)