2019-01-12 04:55:58 +03:00
|
|
|
param (
|
|
|
|
$darcVersion = $null
|
|
|
|
)
|
|
|
|
|
2018-10-06 15:16:26 +03:00
|
|
|
$verbosity = "m"
|
2018-10-17 15:40:37 +03:00
|
|
|
. $PSScriptRoot\tools.ps1
|
2018-10-03 15:20:29 +03:00
|
|
|
|
2019-01-12 04:55:58 +03:00
|
|
|
function InstallDarcCli ($darcVersion) {
|
2018-10-17 15:40:37 +03:00
|
|
|
$darcCliPackageName = "microsoft.dotnet.darc"
|
2018-12-12 18:00:48 +03:00
|
|
|
|
|
|
|
$dotnetRoot = InitializeDotNetCli -install:$true
|
|
|
|
$dotnet = "$dotnetRoot\dotnet.exe"
|
2018-10-24 15:23:00 +03:00
|
|
|
$toolList = Invoke-Expression "& `"$dotnet`" tool list -g"
|
2018-10-17 15:40:37 +03:00
|
|
|
|
|
|
|
if ($toolList -like "*$darcCliPackageName*") {
|
2018-10-24 15:23:00 +03:00
|
|
|
Invoke-Expression "& `"$dotnet`" tool uninstall $darcCliPackageName -g"
|
2018-10-17 15:40:37 +03:00
|
|
|
}
|
|
|
|
|
2019-01-12 04:55:58 +03:00
|
|
|
# Until we can anonymously query the BAR API for the latest arcade-services
|
|
|
|
# build applied to the PROD channel, this is hardcoded.
|
|
|
|
if (-not $darcVersion) {
|
2019-02-25 16:45:40 +03:00
|
|
|
$darcVersion = '1.1.0-beta.19120.2'
|
2019-01-12 04:55:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
$arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-arcade/index.json'
|
2018-10-17 15:40:37 +03:00
|
|
|
|
2019-01-12 04:55:58 +03:00
|
|
|
Write-Host "Installing Darc CLI version $darcVersion..."
|
2018-10-17 15:40:37 +03:00
|
|
|
Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed."
|
2019-01-12 04:55:58 +03:00
|
|
|
Invoke-Expression "& `"$dotnet`" tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g"
|
2018-10-17 15:40:37 +03:00
|
|
|
}
|
|
|
|
|
2019-01-12 04:55:58 +03:00
|
|
|
InstallDarcCli $darcVersion
|