mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-02 00:10:50 +03:00
fix(skd-info): handle absolute -OutFile paths correctly
Раньше PS1-порт делал `Join-Path (Get-Location) $OutFile` без проверки,
что приводило к невалидным склейкам типа `C:\cwd\C:\abs\path.txt`, и
запись падала с «The given path's format is not supported».
Теперь: если путь абсолютный — нормализуется через `Path::GetFullPath`,
если относительный — резолвится против CWD. Python-порт уже был корректен,
только version bump.
Дополнительно: `args_extra` в runner.mjs теперь поддерживает подстановку
`{workDir}` — нужно для тестов с абсолютными путями внутри workspace.
Тесты: `skd-info/outfile-absolute-cyrillic` (PS + Python).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
ce1ba0bab1
commit
334241bea4
@@ -1,4 +1,4 @@
|
||||
# skd-info v1.4 — Analyze 1C DCS structure
|
||||
# skd-info v1.5 — Analyze 1C DCS structure
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
@@ -1875,7 +1875,12 @@ $totalLines = $result.Count
|
||||
# OutFile
|
||||
if ($OutFile) {
|
||||
$utf8Bom = New-Object System.Text.UTF8Encoding($true)
|
||||
[System.IO.File]::WriteAllLines((Join-Path (Get-Location) $OutFile), $result, $utf8Bom)
|
||||
if ([System.IO.Path]::IsPathRooted($OutFile)) {
|
||||
$outPath = [System.IO.Path]::GetFullPath($OutFile)
|
||||
} else {
|
||||
$outPath = [System.IO.Path]::GetFullPath((Join-Path (Get-Location).Path $OutFile))
|
||||
}
|
||||
[System.IO.File]::WriteAllLines($outPath, $result, $utf8Bom)
|
||||
Write-Host "Written $totalLines lines to $OutFile"
|
||||
exit 0
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# skd-info v1.4 — Analyze 1C DCS structure
|
||||
# skd-info v1.5 — Analyze 1C DCS structure
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
|
||||
import argparse
|
||||
|
||||
Reference in New Issue
Block a user