Sync eng/common directory with azure-sdk-tools for PR 8831 (#5913)

* we want the path that we write to to be defined by literalpath, otherwise files with [ or ] will break powershell when writing the file to disk

* slight wording adjustment so the command can be invoked directly

---------

Co-authored-by: Scott Beddall <scbedd@microsoft.com>
This commit is contained in:
Azure SDK Bot 2024-08-14 17:58:38 -07:00 коммит произвёл GitHub
Родитель cf562e0d12
Коммит c3e0967d16
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -111,10 +111,10 @@ function Locate-Assets-Slice($ProxyExe, $AssetsJson, $MountDirectory) {
function Get-Tag-SHA($TagName, $WorkingDirectory) {
$results = Git-Command "ls-remote origin $TagName" $WorkingDirectory
if ($results -and $lastexitcode -eq 0) {
$arr = $results -split '\s+'
return $arr[0]
}
@ -124,7 +124,7 @@ function Get-Tag-SHA($TagName, $WorkingDirectory) {
function Start-Message($AssetsJson, $TargetTags, $AssetsRepoLocation, $MountDirectory) {
$alreadyCombinedTags = Load-Incomplete-Progress $MountDirectory
$TargetTags = $TargetTags | Where-Object { $_ -notin $alreadyCombinedTags }
if ($alreadyCombinedTags) {
@ -172,7 +172,7 @@ function Finish-Message($AssetsJson, $TargetTags, $AssetsRepoLocation, $MountDir
$suffix = if ($len -gt 1) { "s" } else { "" }
Write-Host "`nSuccessfully combined $len tag$suffix. Invoke `"test-proxy push " -NoNewLine
Write-Host "`nSuccessfully combined $len tag$suffix. Invoke `"test-proxy push -a " -NoNewLine
Write-Host $AssetsJson -ForegroundColor Green -NoNewLine
Write-Host "`" to push the results as a new tag."
}
@ -256,7 +256,7 @@ function Combine-Tags($RemainingTags, $AssetsRepoLocation, $MountDirectory, $Rel
$pushedTags = Load-Incomplete-Progress $MountDirectory
$testFile = Get-ChildItem -Recurse -Path $AssetsRepoLocation | Where-Object { !$_.PSIsContainer } | Select-Object -First 1
Add-Content -Path $testFile -Value "`n"
Add-Content -LiteralPath $testFile -Value "`n"
# if we have successfully gotten to the end without any non-zero exit codes...delete the mergeprogress file, we're g2g
Cleanup-Incomplete-Progress $MountDirectory