take only the first match
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user