use exe.getExecOutput instead of exe.exec in the GitHub implementation
This commit is contained in:
@@ -128,24 +128,12 @@ class BuildAgent implements IBuildAgent {
|
|||||||
|
|
||||||
public async exec(exec: string, args: string[]): Promise<IExecResult> {
|
public async exec(exec: string, args: string[]): Promise<IExecResult> {
|
||||||
const dotnetPath = await io.which(exec, true)
|
const dotnetPath = await io.which(exec, true)
|
||||||
let resultCode = 0
|
let result = await exe.getExecOutput(`"${dotnetPath}"`, args);
|
||||||
let stdout = ''
|
|
||||||
let stderr = ''
|
|
||||||
resultCode = await exe.exec(`"${dotnetPath}"`, args, {
|
|
||||||
listeners: {
|
|
||||||
stderr: (data: Buffer) => {
|
|
||||||
stderr += data.toString()
|
|
||||||
},
|
|
||||||
stdout: (data: Buffer) => {
|
|
||||||
stdout += data.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return {
|
return {
|
||||||
code: resultCode,
|
code: result.exitCode,
|
||||||
error: null,
|
error: null,
|
||||||
stderr,
|
stderr: result.stderr,
|
||||||
stdout
|
stdout: result.stdout
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export class DotnetTool implements IDotnetTool {
|
|||||||
protected versionManager: IVersionManager
|
protected versionManager: IVersionManager
|
||||||
private httpClient: http.HttpClient
|
private httpClient: http.HttpClient
|
||||||
|
|
||||||
private static readonly nugetRoot: string = 'https://azuresearch-usnc.nuget.org/'
|
private static readonly nugetRoot: string = 'https://azuresearch-usnc.nuget.org/query'
|
||||||
|
|
||||||
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent, @inject(TYPES.IVersionManager) versionManager: IVersionManager) {
|
constructor(@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent, @inject(TYPES.IVersionManager) versionManager: IVersionManager) {
|
||||||
this.buildAgent = buildAgent
|
this.buildAgent = buildAgent
|
||||||
@@ -116,7 +116,7 @@ export class DotnetTool implements IDotnetTool {
|
|||||||
|
|
||||||
const toolNameParam = encodeURIComponent(toolName.toLowerCase())
|
const toolNameParam = encodeURIComponent(toolName.toLowerCase())
|
||||||
const prereleaseParam = includePrerelease ? 'true' : 'false'
|
const prereleaseParam = includePrerelease ? 'true' : 'false'
|
||||||
const downloadPath = `${DotnetTool.nugetRoot}query?q=${toolNameParam}&prerelease=${prereleaseParam}&semVerLevel=2.0.0&take=1`
|
const downloadPath = `${DotnetTool.nugetRoot}?q=${toolNameParam}&prerelease=${prereleaseParam}&semVerLevel=2.0.0&take=1`
|
||||||
|
|
||||||
const res = await this.httpClient.get(downloadPath)
|
const res = await this.httpClient.get(downloadPath)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user