Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions build/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,22 @@ Function Install-DotnetCLI {

#If "-force" is specified, or folder with specific version doesn't exist, the download command will run"
if ($Force -or -not (Test-Path $probeDotnetPath)) {
Trace-Log "$DotNetInstall -Channel $($cli.Channel) -InstallDir $($cli.Root) -Version $($cli.Version) -Architecture $arch -NoPath"
& $DotNetInstall -Channel $cli.Channel -InstallDir $cli.Root -Version $cli.Version -Architecture $arch -NoPath
$channelMainVersion = ""
foreach($channelPart in $cli.Channel.Split('/'))
{
if ($channelPart -match "\d+.*")
{
$channelMainVersion = $channelPart.Split('.')[0]
Break
}
}

if ([string]::IsNullOrEmpty($channelMainVersion)) {
Error-Log "Unable to detect channel version for dotnetinstall.ps1. The CLI install cannot be initiated." -Fatal
}

Trace-Log "$DotNetInstall -Channel $($channelMainVersion) -Quality Daily -InstallDir $($cli.Root) -Version $($cli.Version) -Architecture $arch -NoPath"
& $DotNetInstall -Channel $channelMainVersion -Quality Daily -InstallDir $cli.Root -Version $cli.Version -Architecture $arch -NoPath
}

if (-not (Test-Path $DotNetExe)) {
Expand Down