Skip to content

Commit fac68b7

Browse files
azure-sdksima-zhu
andauthored
Sync eng/common directory with azure-sdk-tools for PR 2348 (Azure#25740)
* Run install command under tool path * udpate version and comments Co-authored-by: sima-zhu <[email protected]>
1 parent fc8b4e9 commit fac68b7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

eng/common/scripts/get-codeowners.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
param (
22
[string]$TargetDirectory = "", # Code path to code owners. e.g sdk/core/azure-amqp
33
[string]$CodeOwnerFileLocation = (Resolve-Path $PSScriptRoot/../../../.github/CODEOWNERS), # The absolute path of CODEOWNERS file.
4-
[string]$ToolVersion = "1.0.0-dev.20211123.13", # Placeholder. Will update in next PR
4+
[string]$ToolVersion = "1.0.0-dev.20211129.6", # Placeholder. Will update in next PR
55
[string]$ToolPath = (Join-Path ([System.IO.Path]::GetTempPath()) "codeowners-tool-path"), # The place to check the tool existence. Put temp path as default
66
[string]$DevOpsFeed = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json", # DevOp tool feeds.
77
[string]$VsoVariable = "", # Option of write code owners into devop variable
@@ -20,8 +20,12 @@ function Get-CodeOwnersTool()
2020
New-Item -ItemType Directory -Path $ToolPath | Out-Null
2121
}
2222
Write-Host "Installing the retrieve-codeowners tool under $ToolPath... "
23-
dotnet tool install --tool-path $ToolPath --add-source $DevOpsFeed --version $ToolVersion "Azure.Sdk.Tools.RetrieveCodeOwners" | Out-Null
2423

24+
# Run command under tool path to avoid dotnet tool install command checking .csproj files.
25+
# This is a bug for dotnet tool command. Issue: https://github.com/dotnet/sdk/issues/9623
26+
Push-Location $ToolPath
27+
dotnet tool install --tool-path $ToolPath --add-source $DevOpsFeed --version $ToolVersion "Azure.Sdk.Tools.RetrieveCodeOwners" | Out-Null
28+
Pop-Location
2529
# Test to see if the tool properly installed.
2630
if (!(Get-Command $command -errorAction SilentlyContinue)) {
2731
Write-Error "The retrieve-codeowners tool is not properly installed. Please check your tool path. $ToolPath"

0 commit comments

Comments
 (0)