mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-18 08:39:40 +03:00
fix(skills): add sibling XML auto-resolve for directory paths
When a directory is passed (e.g. src/Name or Catalogs/Name), the auto-resolve now also checks for a sibling file ../Name.xml, which is the standard layout for both 1C config dumps and EPF/ERF sources. Affected: meta-info, meta-edit, meta-validate, epf-validate, subsystem-edit, subsystem-info, subsystem-validate (7 scripts). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,8 +22,11 @@ if (-not [System.IO.Path]::IsPathRooted($ObjectPath)) {
|
||||
if (Test-Path $ObjectPath -PathType Container) {
|
||||
$dirName = Split-Path $ObjectPath -Leaf
|
||||
$candidate = Join-Path $ObjectPath "$dirName.xml"
|
||||
$sibling = Join-Path (Split-Path $ObjectPath) "$dirName.xml"
|
||||
if (Test-Path $candidate) {
|
||||
$ObjectPath = $candidate
|
||||
} elseif (Test-Path $sibling) {
|
||||
$ObjectPath = $sibling
|
||||
} else {
|
||||
$xmlFiles = @(Get-ChildItem $ObjectPath -Filter "*.xml" -File | Select-Object -First 1)
|
||||
if ($xmlFiles.Count -gt 0) {
|
||||
|
||||
Reference in New Issue
Block a user