You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

28 lines
1.1 KiB

# -*- coding: utf-8 -*-
"""票 12 bruno-sync:暂存 .bru 拷入 docs 仓 商机模块/商机详情/工作计划/ 并回读校验。"""
import io
import shutil
import sys
from pathlib import Path
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
src = Path('d:/code/crm-backend-matt/.scratch/opportunity-bugfix/t12-bru')
dst = Path('D:/code/crm-api-docs/商机模块/商机详情/工作计划')
dst.mkdir(parents=True, exist_ok=True)
names = ['folder.bru', '工作计划列表.bru', '新增工作计划.bru', '编辑工作计划.bru', '删除工作计划.bru']
for n in names:
s = src / n
d = dst / n
if not s.exists():
print(f'✗ 暂存缺失 {n}')
sys.exit(1)
shutil.copyfile(s, d)
print(f'{d} ({d.stat().st_size} bytes)')
print('\n回读校验(docs 仓):')
for n in names:
t = (dst / n).read_text(encoding='utf-8')
head = t.splitlines()[2] if n == 'folder.bru' else next(l for l in t.splitlines() if l.startswith(' url:') or l.startswith(' name:'))
print(f' {n}: 行数={len(t.splitlines())} 锚={head.strip()}')