commit ccffc82af6f42f583127279798d1973afb12c266 parent 86066f2eb06e9fac99f603a7737b1af473b69e8c Author: Hugo Soucy <hugo@soucy.cc> Date: Thu, 22 Apr 2021 10:28:32 -0400 Test if there is a meta file else return nil Diffstat:
M | satelito/file.lua | | | 6 | +++++- |
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/satelito/file.lua b/satelito/file.lua @@ -75,7 +75,11 @@ function file.get_exportlink(filepath, dirname, htmlpath) end function file.get_metafile(filepath) - return dofile(filepath:match('(.+)%..*') .. '.lua') + if lfs.attributes(filepath:match('(.+)%..*') .. '.lua') then + return dofile(filepath:match('(.+)%..*') .. '.lua') + else + return nil + end end -- Get the modified file from a list of paths