Files
cmsp/.gitattributes
QiuSWandClaude Opus 5 080a77ab5d chore: 增加 run_dev.bat 与 build.bat 启动打包脚本
面向初级维护者:每个检查失败都写明「怎么修」而不只是报错。
- run_dev.bat:检查 Go/Node/Wails/配置/前端依赖后启动开发模式,
  缺 config.yaml 时自动从 config.example.yaml 复制
- build.bat:打包前先跑单元测试,测试不过拒绝打包(可用 skiptest 强制);
  打包成功后提示不要把 config.yaml 和 cmsp.db 一起发给同事

两个脚本必须是 GBK 编码 + CRLF 行尾:cmd 用系统 ANSI 代码页解析 .bat,
存成 UTF-8 会让中文注释把命令行拆坏(实测报「不是内部命令」);
UTF-8 带 BOM 则会让 @echo off 失效。.gitattributes 用 *.bat -text
让 Git 原样存取,已验证磁盘字节与 Git 存储字节一致。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbdtsD3ohhSMy3KPoCgARq
2026-09-02 16:45:02 +08:00

20 lines
733 B
Plaintext

# 仓库内文本统一以 LF 存储,避免 Windows/WSL 混用产生全量行尾差异。
# 行尾差异会淹没真实改动,也会让 gitea.env 之类的配置在 bash 中带上 \r。
* text=auto eol=lf
*.py text eol=lf
*.md text eol=lf
*.json text eol=lf
*.ps1 text eol=crlf
# 批处理脚本 Git 一律不做任何转换:
# - 必须是 CRLF 行尾,LF 会让 cmd 解析 goto 标签和多行块出错
# - 必须是 GBK 编码,cmd 用系统 ANSI 代码页解析 .bat,
# 存成 UTF-8 会让中文注释把命令行拆坏(实测会报「不是内部命令」)
# 用 -text 让 Git 按二进制原样存取,避免任何自动换行或编码转换。
*.bat -text
*.png binary
*.jpg binary
*.zip binary