Skip to content

Commit

Permalink
add update version script to build.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Udi-Fogiel committed Apr 18, 2024
1 parent 3d703f8 commit adcbc4b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,36 @@ tdslocations = {
}
unpackfiles = {"*.map"}
unpackexe = "teckit_compile"

tagfiles = {"tex/polyglossia.sty", "tex/*.ldf", "tex/*.lua", "doc/polyglossia.tex", "README.md"}
function update_tag(file,content,tagname,tagdate)
if string.match(file, "%.ldf$") then
return string.gsub(content,
"%% Language definition file %(part of polyglossia v%d%.%d+ %-%- %d%d%d%d/%d%d/%d%d%)\n",
"%% Language definition file (part of polyglossia " .. tagname .. " -- " .. tagdate .. ")\n")
elseif string.match(file, "%.lua$") then
return string.gsub(content,
"\n%-%- part of polyglossia v%d%.%d+ %-%- %d%d%d%d/%d%d/%d%d\n",
"\n-- part of polyglossia " .. tagname .. " -- " .. tagdate .. "\n")
elseif file == "polyglossia.tex" then
return string.gsub(content,
"\n\\subsection%*{%d%.%d %(forthcoming%)}\n",
"\n\\subsection*{" .. tagname .. " (" .. tagdate .. ")}\n")
elseif file == "polyglossia.sty" then
return string.gsub(content,
"\n {polyglossia} {%d%d%d%d/%d%d/%d%d} {v%d%.%d+}\n",
"\n {polyglossia} {" .. tagdate .. "} {" .. tagname .. "}\n")
elseif file == "README.md" then
content = string.gsub(content,
"# THE POLYGLOSSIA PACKAGE v%d%.%d\n",
"# THE POLYGLOSSIA PACKAGE " .. tagname .. "\n")
local names = {"Arthur", "Udi", "Jürgen"}
for name = 1, #names do
content = string.gsub(content,
"(%-%d%d%d%d) (" .. names[name] .. ")",
"-" .. string.sub(tagdate, 1, 4) .. " %2")
end
return content
end
return content
end

0 comments on commit adcbc4b

Please sign in to comment.