ソースを参照

添加脚本和配置以转换CRLF为LF

添加了crlf2lf.sh脚本用于将项目中的文件从CRLF格式转换为LF格式,并在.gitattributes中设置了文本文件的换行符规则,确保所有文本文件使用LF作为换行符。
SongZihuan 3 ヶ月 前
コミット
f8a4960235
2 ファイル変更10 行追加0 行削除
  1. 1 0
      .gitattributes
  2. 9 0
      crlf2lf.sh

+ 1 - 0
.gitattributes

@@ -0,0 +1 @@
+* text=auto eol=lf

+ 9 - 0
crlf2lf.sh

@@ -0,0 +1,9 @@
+# 使用Git Bash运行
+# 需要先安装<chocolatey>
+# 安装命令:iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
+# 若安装过程提示无权限执行脚本,则:Set-ExecutionPolicy Bypass -Scope Process -Force
+# 并且删除<C:\ProgramData\chocolatey>目录。
+# 安装完成后使用<choco --version>查看版本,确定安装成功
+# 安装<dos2unix>:choco install dos2unix
+
+find . -type f -name '*' -print0 | xargs -0 dos2unix