mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-06 19:50:20 +03:00
feat(validate): auto-resolve directory paths, fix SKILL.md placeholders
Scripts now accept directory paths (e.g. Forms/ИмяФормы) and auto-resolve to the target XML file. Silent fallbacks handle missing Ext/ level and descriptor-to-file resolution. SKILL.md: concrete placeholders, unified quotes, auto-resolve notes, role-validate MaxErrors in params. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
422e397381
commit
b2a2534b5a
@@ -12,6 +12,27 @@ param(
|
||||
$ErrorActionPreference = "Stop"
|
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
|
||||
# --- Resolve path ---
|
||||
# A: Directory → Ext/Form.xml
|
||||
if (Test-Path $FormPath -PathType Container) {
|
||||
$FormPath = Join-Path (Join-Path $FormPath "Ext") "Form.xml"
|
||||
}
|
||||
# B1: Missing Ext/ (e.g. Forms/Форма/Form.xml → Forms/Форма/Ext/Form.xml)
|
||||
if (-not (Test-Path $FormPath)) {
|
||||
$fn = [System.IO.Path]::GetFileName($FormPath)
|
||||
if ($fn -eq "Form.xml") {
|
||||
$c = Join-Path (Join-Path (Split-Path $FormPath) "Ext") $fn
|
||||
if (Test-Path $c) { $FormPath = $c }
|
||||
}
|
||||
}
|
||||
# B2: Descriptor (Forms/Форма.xml → Forms/Форма/Ext/Form.xml)
|
||||
if (-not (Test-Path $FormPath) -and $FormPath.EndsWith(".xml")) {
|
||||
$stem = [System.IO.Path]::GetFileNameWithoutExtension($FormPath)
|
||||
$dir = Split-Path $FormPath
|
||||
$c = Join-Path (Join-Path (Join-Path $dir $stem) "Ext") "Form.xml"
|
||||
if (Test-Path $c) { $FormPath = $c }
|
||||
}
|
||||
|
||||
# --- Load XML ---
|
||||
|
||||
if (-not (Test-Path $FormPath)) {
|
||||
|
||||
Reference in New Issue
Block a user