2019-01-12 01:39:30 +00:00
|
|
|
param (
|
|
|
|
$darcVersion = $null
|
|
|
|
)
|
|
|
|
|
2018-10-22 05:07:26 +00:00
|
|
|
$verbosity = "m"
|
|
|
|
. $PSScriptRoot\tools.ps1
|
|
|
|
|
2019-01-12 01:39:30 +00:00
|
|
|
function InstallDarcCli ($darcVersion) {
|
2018-10-22 05:07:26 +00:00
|
|
|
$darcCliPackageName = "microsoft.dotnet.darc"
|
2018-12-19 20:55:42 +00:00
|
|
|
|
|
|
|
$dotnetRoot = InitializeDotNetCli -install:$true
|
|
|
|
$dotnet = "$dotnetRoot\dotnet.exe"
|
2018-11-08 01:51:56 +00:00
|
|
|
$toolList = Invoke-Expression "& `"$dotnet`" tool list -g"
|
2018-10-22 05:07:26 +00:00
|
|
|
|
|
|
|
if ($toolList -like "*$darcCliPackageName*") {
|
2018-11-08 01:51:56 +00:00
|
|
|
Invoke-Expression "& `"$dotnet`" tool uninstall $darcCliPackageName -g"
|
2018-10-22 05:07:26 +00:00
|
|
|
}
|
|
|
|
|
2019-01-12 01:39:30 +00: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-04-06 12:33:29 +00:00
|
|
|
$darcVersion = '1.1.0-beta.19205.4'
|
2019-01-12 01:39:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-arcade/index.json'
|
2018-10-22 05:07:26 +00:00
|
|
|
|
2019-01-12 01:39:30 +00:00
|
|
|
Write-Host "Installing Darc CLI version $darcVersion..."
|
2018-10-22 05:07:26 +00:00
|
|
|
Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed."
|
2019-01-12 01:39:30 +00:00
|
|
|
Invoke-Expression "& `"$dotnet`" tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g"
|
2018-10-22 05:07:26 +00:00
|
|
|
}
|
|
|
|
|
2019-01-12 01:39:30 +00:00
|
|
|
InstallDarcCli $darcVersion
|