From 3e7e105c43f4ab8b43ad31a964565f6c97a510f8 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Tue, 11 Aug 2026 12:16:42 +0300 Subject: [PATCH] =?UTF-8?q?fix(mxl-compile):=20=D0=BF=D0=B8=D1=81=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20=D0=B2=20?= =?UTF-8?q?stderr=20=D0=BD=D0=B0=D0=BF=D1=80=D1=8F=D0=BC=D1=83=D1=8E,=20?= =?UTF-8?q?=D0=B0=20=D0=BD=D0=B5=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20Write-?= =?UTF-8?q?Error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Write-Error оборачивает сообщение в ErrorRecord: приписывает имя скрипта, добавляет хвост CategoryInfo и ломает текст по ширине окна консоли. Длинные сообщения приезжали разорванными посреди слова, и по ним нельзя было ни искать подстроку, ни читать их глазами. Остальные четырнадцать мест в файле уже писали через Console.Error — приведены оставшиеся шесть. Тексты сообщений не менялись. Co-Authored-By: Claude Opus 5 (1M context) --- .claude/skills/mxl-compile/scripts/mxl-compile.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.claude/skills/mxl-compile/scripts/mxl-compile.ps1 b/.claude/skills/mxl-compile/scripts/mxl-compile.ps1 index e7f1c461..fd076e82 100644 --- a/.claude/skills/mxl-compile/scripts/mxl-compile.ps1 +++ b/.claude/skills/mxl-compile/scripts/mxl-compile.ps1 @@ -185,7 +185,7 @@ $script:formatVersion = Detect-FormatVersion ([System.IO.Path]::GetDirectoryName # --- 1. Load and validate JSON --- if (-not (Test-Path $JsonPath)) { - Write-Error "File not found: $JsonPath" + [Console]::Error.WriteLine("File not found: $JsonPath") exit 1 } @@ -197,11 +197,11 @@ $def = $json | ConvertFrom-Json # список областей встречается у макета без строк. Прежняя проверка `-not` объявляла и то # и другое отсутствующим. if (-not $def.PSObject.Properties['columns'] -or $null -eq $def.columns) { - Write-Error "Required field 'columns' is missing" + [Console]::Error.WriteLine("Required field 'columns' is missing") exit 1 } if (-not $def.PSObject.Properties['areas'] -or $null -eq $def.areas) { - Write-Error "Required field 'areas' is missing" + [Console]::Error.WriteLine("Required field 'areas' is missing") exit 1 } @@ -963,14 +963,14 @@ foreach ($area in $def.areas) { $cursor++ } if (($cursor + $colSpan - 1) -gt $areaColumns) { - Write-Error "Row exceeds 'columns' ($areaColumns): area `"$areaName`", row $($localRow + 1)" + [Console]::Error.WriteLine("Row exceeds 'columns' ($areaColumns): area `"$areaName`", row $($localRow + 1)") exit 1 } $cell | Add-Member -NotePropertyName col -NotePropertyValue $cursor -Force $cursor += $colSpan } } elseif ($positioned.Count -ne $row.cells.Count) { - Write-Error "Cell without 'col' mixed with positioned cells: area `"$areaName`", row $($localRow + 1)" + [Console]::Error.WriteLine("Cell without 'col' mixed with positioned cells: area `"$areaName`", row $($localRow + 1)") exit 1 } @@ -981,7 +981,7 @@ foreach ($area in $def.areas) { $cellIdx++ $colParsed = 0 if (-not [int]::TryParse("$($cell.col)", [ref]$colParsed) -or $colParsed -lt 1 -or $colParsed -gt $areaColumns) { - Write-Error "Invalid 'col' value `"$($cell.col)`": area `"$areaName`", row $($localRow + 1), cell $cellIdx" + [Console]::Error.WriteLine("Invalid 'col' value `"$($cell.col)`": area `"$areaName`", row $($localRow + 1), cell $cellIdx") exit 1 } }