From 9426dcdc696a9933cd943f3b2831ff7a6e8597dc Mon Sep 17 00:00:00 2001 From: Imple Lee <80144331+ImpleLee@users.noreply.github.com> Date: Mon, 4 Apr 2022 12:28:42 +0800 Subject: [PATCH] better .gitattributes (#680) * better .gitattributes * .gitattributes per directory * No binary file detection https://stackoverflow.com/questions/57030698 * fix .github/actions/*/*.yml --- .gitattributes | 9 ----- .github/.gitattributes | 2 + .github/build/Linux/.gitattributes | 1 + .github/build/Windows/.gitattributes | 1 + .github/build/macOS/.gitattributes | 1 + .github/workflows/getVersion.lua | 56 ++++++++++++++-------------- 6 files changed, 33 insertions(+), 37 deletions(-) create mode 100644 .github/.gitattributes create mode 100644 .github/build/Linux/.gitattributes create mode 100644 .github/build/Windows/.gitattributes create mode 100644 .github/build/macOS/.gitattributes diff --git a/.gitattributes b/.gitattributes index 9f4a02f2..176a458f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,10 +1 @@ * text=auto - -.lua text eol=crlf -.glsl text eol=crlf -.txt text eol=crlf -.md text eol=crlf - -*.ogg binary -*.png binary -*.jpg binary diff --git a/.github/.gitattributes b/.github/.gitattributes new file mode 100644 index 00000000..4c92bf54 --- /dev/null +++ b/.github/.gitattributes @@ -0,0 +1,2 @@ +actions/**/*.yml text eol=lf +workflows/*.yml text eol=lf diff --git a/.github/build/Linux/.gitattributes b/.github/build/Linux/.gitattributes new file mode 100644 index 00000000..c179c320 --- /dev/null +++ b/.github/build/Linux/.gitattributes @@ -0,0 +1 @@ +*.template text eol=lf diff --git a/.github/build/Windows/.gitattributes b/.github/build/Windows/.gitattributes new file mode 100644 index 00000000..d773a295 --- /dev/null +++ b/.github/build/Windows/.gitattributes @@ -0,0 +1 @@ +*.template text eol=crlf diff --git a/.github/build/macOS/.gitattributes b/.github/build/macOS/.gitattributes new file mode 100644 index 00000000..c179c320 --- /dev/null +++ b/.github/build/macOS/.gitattributes @@ -0,0 +1 @@ +*.template text eol=lf diff --git a/.github/workflows/getVersion.lua b/.github/workflows/getVersion.lua index b50b0901..cade35d3 100644 --- a/.github/workflows/getVersion.lua +++ b/.github/workflows/getVersion.lua @@ -1,28 +1,28 @@ -local arg=arg[1] -if arg=="-apkCode"then - local code=require"version".apkCode - print(code) -elseif arg=="-code"then - local str=require"version".code - print(str) -elseif arg=="-name"then - local str=require"version".string - print(str) -elseif arg=="-release"then - local str=require"version".string:gsub("V","",1) - print(str) -elseif arg=="-updateTitle"then - local note=require"parts.updateLog" - local p1=note:find("\n%d")+1 - local p2=note:find("\n",p1)-1 - note=note:sub(p1,p2) - print(note) -elseif arg=="-updateNote"then - local note=require"parts.updateLog" - local p1=note:find("\n",note:find("\n%d")+1)+1 - local p2=note:find("\n%d",p1+1) - note=note:sub(p1,p2-2) - :gsub(" ","- ") - :gsub(" ","# ") - print(note) -end +local arg=arg[1] +if arg=="-apkCode"then + local code=require"version".apkCode + print(code) +elseif arg=="-code"then + local str=require"version".code + print(str) +elseif arg=="-name"then + local str=require"version".string + print(str) +elseif arg=="-release"then + local str=require"version".string:gsub("V","",1) + print(str) +elseif arg=="-updateTitle"then + local note=require"parts.updateLog" + local p1=note:find("\n%d")+1 + local p2=note:find("\n",p1)-1 + note=note:sub(p1,p2) + print(note) +elseif arg=="-updateNote"then + local note=require"parts.updateLog" + local p1=note:find("\n",note:find("\n%d")+1)+1 + local p2=note:find("\n%d",p1+1) + note=note:sub(p1,p2-2) + :gsub(" ","- ") + :gsub(" ","# ") + print(note) +end