[latex3-commits] [latex3/l3build] main: Convert "old" year to int. when updating copyright (5e359d7)

github at latex-project.org github at latex-project.org
Thu Jan 4 10:56:32 CET 2024


Repository : https://github.com/latex3/l3build
On branch  : main
Link       : https://github.com/latex3/l3build/commit/5e359d796b766d39609827116bf9944af0b94f3f

>---------------------------------------------------------------

commit 5e359d796b766d39609827116bf9944af0b94f3f
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Jan 4 09:56:32 2024 +0000

    Convert "old" year to int. when updating copyright


>---------------------------------------------------------------

5e359d796b766d39609827116bf9944af0b94f3f
 build.lua | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/build.lua b/build.lua
index 18eaaf7..f8f34c6 100644
--- a/build.lua
+++ b/build.lua
@@ -51,13 +51,14 @@ function update_tag(file,content,tagname,tagdate)
   local url = "https://github.com/latex3/l3build/compare/"
   -- update copyright
   local year = os.date("%Y")
-  if string.match(content,"%(C%)%s*" .. (year - 1) .. " The LaTeX Project") then
+  local oldyear = math.tointeger(year - 1)
+  if string.match(content,"%(C%)%s*" .. oldyear .. " The LaTeX Project") then
     content = string.gsub(content,
-      "%(C%)%s*" .. (year - 1) .. " The LaTeX Project",
+      "%(C%)%s*" .. oldyear .. " The LaTeX Project",
       "(C) " .. year .. " The LaTeX Project")
-  elseif string.match(content,"%(C%)%s*%d%d%d%d%-" .. (year - 1) .. " The LaTeX Project") then
+  elseif string.match(content,"%(C%)%s*%d%d%d%d%-" .. oldyear .. " The LaTeX Project") then
     content = string.gsub(content,
-      "%(C%)%s*(%d%d%d%d%-)" .. (year - 1) .. " The LaTeX Project",
+      "%(C%)%s*(%d%d%d%d%-)" .. oldyear .. " The LaTeX Project",
       "(C) %1" .. year .. " The LaTeX Project")
   end
   -- update release date





More information about the latex3-commits mailing list.