[latex3-commits] [git/LaTeX3-latex3-l3build] master: allow .lua suffix for -c option (103fb51)

Will Robertson wspr81 at gmail.com
Fri Feb 1 12:58:22 CET 2019


Repository : https://github.com/latex3/l3build
On branch  : master
Link       : https://github.com/latex3/l3build/commit/103fb5132996a9293112023dcd28132dd99b558f

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

commit 103fb5132996a9293112023dcd28132dd99b558f
Author: Will Robertson <wspr81 at gmail.com>
Date:   Fri Feb 1 22:28:22 2019 +1030

    allow .lua suffix for -c option
    
    IMO it doesn't do any harm to allow both
    
       --config build-a
       --config build-a.lua
    
    and I think it avoids some confusion...


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

103fb5132996a9293112023dcd28132dd99b558f
 l3build.lua |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/l3build.lua b/l3build.lua
index 021981d..6089166 100755
--- a/l3build.lua
+++ b/l3build.lua
@@ -37,6 +37,7 @@ local ipairs           = ipairs
 local insert           = table.insert
 local lookup           = kpse.lookup
 local match            = string.match
+local gsub             = string.gsub
 local next             = next
 local print            = print
 local select           = select
@@ -174,7 +175,7 @@ end
 if #checkconfigs == 1 and
    checkconfigs[1] ~= "build" and
    (options["target"] == "check" or options["target"] == "save") then
-   local config = "./" .. checkconfigs[1] .. ".lua"
+   local config = "./" .. gsub(checkconfigs[1],".lua$","") .. ".lua"
    if fileexists(config) then
      dofile(config)
      testdir = testdir .. "-" .. checkconfigs[1]





More information about the latex3-commits mailing list