mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-03 08:40:52 +03:00
fix(mxl-compile): PS-порт не создавал каталог назначения
Наполнение макета по свежему пути (Templates/<Имя>/Ext/Template.xml) на PowerShell падало с «Could not find a part of the path». py-порт каталог создаёт, form-compile и skd-compile — тоже; не создавал только этот порт. Тестами не ловилось: во всех кейсах mxl-compile писал в уже существующий каталог. Добавлен кейс с записью по несуществующему пути — проверено, что на коде до правки он падает. Найдено при разборе вопроса, нужна ли заглушка тела макета в template-add: оказалось, заглушка держала не замысел, а этот дефект. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
a7406d0982
commit
4833c3b707
@@ -1,4 +1,4 @@
|
|||||||
# mxl-compile v1.7 — Compile 1C spreadsheet from JSON
|
# mxl-compile v1.8 — Compile 1C spreadsheet from JSON
|
||||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
@@ -854,6 +854,11 @@ X '</document>'
|
|||||||
|
|
||||||
$enc = New-Object System.Text.UTF8Encoding($true)
|
$enc = New-Object System.Text.UTF8Encoding($true)
|
||||||
$resolvedPath = if ([System.IO.Path]::IsPathRooted($OutputPath)) { $OutputPath } else { Join-Path (Get-Location) $OutputPath }
|
$resolvedPath = if ([System.IO.Path]::IsPathRooted($OutputPath)) { $OutputPath } else { Join-Path (Get-Location) $OutputPath }
|
||||||
|
# Каталог назначения создаём сами: типовой путь — Templates/<Имя>/Ext/Template.xml,
|
||||||
|
# и его может ещё не быть. Так делают и form-compile, и skd-compile, и py-порт этого
|
||||||
|
# навыка; без этого PS-порт падал на «Could not find a part of the path».
|
||||||
|
$outDir = [System.IO.Path]::GetDirectoryName($resolvedPath)
|
||||||
|
if ($outDir -and -not (Test-Path $outDir)) { New-Item -ItemType Directory -Path $outDir -Force | Out-Null }
|
||||||
Assert-EditAllowed $resolvedPath 'editable'
|
Assert-EditAllowed $resolvedPath 'editable'
|
||||||
[System.IO.File]::WriteAllText($resolvedPath, $xml.ToString().TrimEnd("`r", "`n"), $enc)
|
[System.IO.File]::WriteAllText($resolvedPath, $xml.ToString().TrimEnd("`r", "`n"), $enc)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# mxl-compile v1.7 — Compile 1C spreadsheet from JSON
|
# mxl-compile v1.8 — Compile 1C spreadsheet from JSON
|
||||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"name": "Запись по несуществующему пути: каталог назначения создаётся навыком",
|
||||||
|
"input": {
|
||||||
|
"columns": 1,
|
||||||
|
"areas": [
|
||||||
|
{
|
||||||
|
"name": "Шапка",
|
||||||
|
"rows": [
|
||||||
|
{ "cells": [{ "col": 1, "text": "Привет" }] }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"params": { "outputPath": "Templates/Макет/Ext/Template.xml" },
|
||||||
|
"validatePath": "Templates/Макет/Ext/Template.xml",
|
||||||
|
"expect": {
|
||||||
|
"files": ["Templates/Макет/Ext/Template.xml"],
|
||||||
|
"preserves": {
|
||||||
|
"file": "Templates/Макет/Ext/Template.xml",
|
||||||
|
"bom": true,
|
||||||
|
"eol": "crlf",
|
||||||
|
"encoding": "UTF-8",
|
||||||
|
"finalNewline": false,
|
||||||
|
"noCR13": true,
|
||||||
|
"selfClose": "tight",
|
||||||
|
"noEmptyPairs": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<document xmlns="http://v8.1c.ru/8.2/data/spreadsheet" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<languageSettings>
|
||||||
|
<currentLanguage>ru</currentLanguage>
|
||||||
|
<defaultLanguage>ru</defaultLanguage>
|
||||||
|
<languageInfo>
|
||||||
|
<id>ru</id>
|
||||||
|
<code>Русский</code>
|
||||||
|
<description>Русский</description>
|
||||||
|
</languageInfo>
|
||||||
|
</languageSettings>
|
||||||
|
<columns>
|
||||||
|
<size>1</size>
|
||||||
|
</columns>
|
||||||
|
<rowsItem>
|
||||||
|
<index>0</index>
|
||||||
|
<row>
|
||||||
|
<c>
|
||||||
|
<i>0</i>
|
||||||
|
<c>
|
||||||
|
<f>2</f>
|
||||||
|
<tl>
|
||||||
|
<v8:item>
|
||||||
|
<v8:lang>ru</v8:lang>
|
||||||
|
<v8:content>Привет</v8:content>
|
||||||
|
</v8:item>
|
||||||
|
</tl>
|
||||||
|
</c>
|
||||||
|
</c>
|
||||||
|
</row>
|
||||||
|
</rowsItem>
|
||||||
|
<templateMode>true</templateMode>
|
||||||
|
<defaultFormatIndex>1</defaultFormatIndex>
|
||||||
|
<height>1</height>
|
||||||
|
<vgRows>1</vgRows>
|
||||||
|
<namedItem xsi:type="NamedItemCells">
|
||||||
|
<name>Шапка</name>
|
||||||
|
<area>
|
||||||
|
<type>Rows</type>
|
||||||
|
<beginRow>0</beginRow>
|
||||||
|
<endRow>0</endRow>
|
||||||
|
<beginColumn>-1</beginColumn>
|
||||||
|
<endColumn>-1</endColumn>
|
||||||
|
</area>
|
||||||
|
</namedItem>
|
||||||
|
<font faceName="Arial" height="10" bold="false" italic="false" underline="false" strikeout="false" kind="Absolute" scale="100"/>
|
||||||
|
<format>
|
||||||
|
<width>10</width>
|
||||||
|
</format>
|
||||||
|
<format>
|
||||||
|
<font>0</font>
|
||||||
|
<fillType>Text</fillType>
|
||||||
|
</format>
|
||||||
|
</document>
|
||||||
Reference in New Issue
Block a user