Ужесточены сценарии обновления перевода для AI-агента

This commit is contained in:
2026-04-09 16:03:02 +03:00
parent d048a33c55
commit 7f189aa741
4 changed files with 46 additions and 15 deletions

View File

@@ -51,13 +51,14 @@ try {
return
}
$effectiveEditsPath = $EditsPath
if ([string]::IsNullOrWhiteSpace($effectiveEditsPath)) {
$effectiveEditsPath = Join-Path $resolvedOutputDir "candidates.json"
if ([string]::IsNullOrWhiteSpace($EditsPath)) {
Write-Host "[update-translation.ps1] Найдены изменения перевода. Подготовьте правки в '$([System.IO.Path]::GetFullPath((Join-Path $resolvedOutputDir "candidates.json")))' и затем запустите повторно с '-EditsPath'."
return
}
$effectiveEditsPath = [System.IO.Path]::GetFullPath($EditsPath)
if (-not (Test-Path -LiteralPath $effectiveEditsPath)) {
throw "Translation changes were found. Prepare edits in '$([System.IO.Path]::GetFullPath((Join-Path $resolvedOutputDir "candidates.json")))' and rerun update with '-EditsPath'."
throw "Prepared edits file was not found: '$effectiveEditsPath'."
}
& $applyScriptPath -RussianPath $RussianPath -EditsPath $effectiveEditsPath