chore: 加 .gitattributes 锁定换行符(修跨平台脚本隐患)

core.autocrlf 在不同机器上会把 .command/.sh 转成 CRLF,导致 Mac 用户
双击 .command 报 bad interpreter。明确锁定:
- .bat/.cmd/.ps1 → CRLF(Windows 批处理需要)
- .command/.sh/.mjs/.js/.json → LF(Mac/Linux 需要)

附带把 install/README.md、Windows-Menu.bat 的换行一次性规范化(纯换行,
无内容改动)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hfshfg
2026-06-15 12:29:45 +08:00
parent 01ed1348ef
commit 2d0f33d5a0
4 changed files with 963 additions and 942 deletions

21
.gitattributes vendored Normal file
View File

@@ -0,0 +1,21 @@
# 锁定换行符,保证跨平台分发的脚本可用:
# - Windows 批处理 .bat/.cmd 必须 CRLF否则部分 Windows 环境解析异常
# - Mac/Linux 的 .command/.sh 必须 LF否则双击/执行会报 bad interpreter
# - .mjs/.js 统一 LF
# 防止 core.autocrlf 在不同机器上把换行改乱。
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
*.command text eol=lf
*.sh text eol=lf
*.mjs text eol=lf
*.js text eol=lf
*.json text eol=lf
# 二进制:不做换行转换
*.png binary
*.jpg binary
*.zip binary
*.ico binary