diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..eb72336 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +# 换行与编码的硬约束(2026-09-13) +# +# 为什么需要这个文件:本机 `core.autocrlf=true`,git 在 add 时会把工作区的 CRLF +# 静默存成 LF。而 **cmd 对 LF-only 的 .bat 会行边界错乱** —— 把本该 echo 出去的 +# 说明文字当命令执行(实测报 `AT 命令已弃用`、`']' 不是内部或外部命令`, +# 甚至真的去跑脚本)。只靠各自机器的 git 配置保不住这件事:换台机器、换个 CI, +# clone 出来就是 LF,双击直接失败。所以在仓库层面钉死。 +# +# 配合 `tools/make_launcher_bat.py`:那个生成器负责**写**文件时用 +# GBK + CRLF + 无 BOM,这里负责**存**的时候别把 CRLF 弄丢。 +*.bat text eol=crlf +*.cmd text eol=crlf