diff --git a/scripts/release.ps1 b/scripts/release.ps1 index 509595c..11f9f09 100644 --- a/scripts/release.ps1 +++ b/scripts/release.ps1 @@ -61,8 +61,11 @@ $env:GOOS = '' $env:GOARCH = '' Remove-Item Env:GOARM, Env:GOMIPS -ErrorAction SilentlyContinue +$ErrorActionPreference = "Continue" & make build-all VERSION=$Version -if ($LASTEXITCODE -ne 0) { +$buildExit = $LASTEXITCODE +$ErrorActionPreference = "Stop" +if ($buildExit -ne 0) { Write-Host "!!! Ошибка компиляции." -ForegroundColor Red exit 1 } @@ -112,8 +115,10 @@ if ($existingTag) { } else { git tag -a $tag -m "Release $tag" } -git push origin $tag 2>$null -git push origin master 2>$null +$ErrorActionPreference = "Continue" +git push origin $tag 2>&1 | Out-Null +git push origin master 2>&1 | Out-Null +$ErrorActionPreference = "Stop" # ── Проверка токена ─────────────────────────────────────────────────────────── @@ -136,7 +141,9 @@ Write-Host ">>> [5/6] Создание релиза в Gitea..." -ForegroundColo $commit = git rev-parse HEAD $date = Get-Date -Format 'dd.MM.yyyy HH:mm UTC' $prevTag = '' -try { $prevTag = git describe --tags --abbrev=0 "$tag^" 2>$null } catch {} +$ErrorActionPreference = "Continue" +try { $prevTag = git describe --tags --abbrev=0 "$tag^" 2>&1 | Where-Object { $_ -is [string] } } catch {} +$ErrorActionPreference = "Stop" $rawLog = @() if ($prevTag) {