#691 - made possible to force install the latest version matching versionSpec

This commit is contained in:
Artur
2023-03-11 06:11:00 +01:00
parent 364926b235
commit 6f17d14286
56 changed files with 644 additions and 429 deletions

View File

@@ -4,13 +4,13 @@ import * as path from 'path'
import * as http from 'typed-rest-client/HttpClient'
import { inject, injectable } from 'inversify'
import { TYPES, IExecResult, IBuildAgent } from './models'
import { IBuildAgent, IExecResult, TYPES } from './models'
import { IVersionManager } from './versionManager'
import { ISetupSettings } from '../tools/common/models'
export interface IDotnetTool {
disableTelemetry(): void
toolInstall(toolName: string, checkLatest: boolean, setupSettings: ISetupSettings): Promise<string>
toolInstall(toolName: string, setupSettings: ISetupSettings): Promise<string>
}
@injectable()
@@ -37,13 +37,14 @@ export class DotnetTool implements IDotnetTool {
return this.buildAgent.exec(cmd, args)
}
public async toolInstall(toolName: string, checkLatest: boolean, setupSettings: ISetupSettings): Promise<string> {
public async toolInstall(toolName: string, setupSettings: ISetupSettings): Promise<string> {
console.log('')
console.log('--------------------------')
console.log(`Acquiring ${toolName} version spec: ${setupSettings.versionSpec}`)
console.log('--------------------------')
let version: string
let checkLatest = setupSettings.preferLatestVersion
if (this.versionManager.isExplicitVersion(setupSettings.versionSpec)) {
checkLatest = false // check latest doesn't make sense when explicit version
version = setupSettings.versionSpec