Skip to content

Commit

Permalink
[Asset sync] Handle additional git remote format (#4929)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Beddall <[email protected]>
  • Loading branch information
mccoyp and scbedd authored Dec 9, 2022
1 parent b3ea511 commit 6b38716
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,13 @@ Function Get-Repo-Language {
# origin [email protected]:Azure/azure-sdk-for-python-pr.git (fetch)
# fork [email protected]:UserName/azure-sdk-for-python (fetch)
# azure-sdk https://github.com/azure-sdk/azure-sdk-for-net.git (fetch)
# origin https://github.com/Azure/azure-sdk-for-python/ (fetch)
# ForEach-Object splits the string on whitespace so each of the above strings is actually
# 3 different strings. The first and last pieces won't match anything, the middle string
# will match what is below. If the regular expression needs to be updated the following
# link below will go to a regex playground
# https://regex101.com/r/btVW5A/1
$lang = $remotes[0] | ForEach-Object { if ($_ -match "azure-sdk-for-(?<lang>[^\-\.]+)") {
# https://regex101.com/r/auOnAr/1
$lang = $remotes[0] | ForEach-Object { if ($_ -match "azure-sdk-for-(?<lang>[^\-\.\/ ]+)") {
#Return the named language match
return $Matches["lang"]
}
Expand Down

0 comments on commit 6b38716

Please sign in to comment.