From 2eaee0eba05a703234563417d674bc2e4a7b4e96 Mon Sep 17 00:00:00 2001 From: dvs1 Date: Sun, 16 Mar 2025 13:33:44 +1000 Subject: Deal with complex directory trees. Just do the simple thing, drop a file in it so it's not empty. --- notYetAnotherWiki.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'notYetAnotherWiki.lua') diff --git a/notYetAnotherWiki.lua b/notYetAnotherWiki.lua index e84e9b0..53e3682 100755 --- a/notYetAnotherWiki.lua +++ b/notYetAnotherWiki.lua @@ -430,6 +430,19 @@ for name, file in pairs(Files) do end end +-- Find empty subs. +for name, sub in pairs(Subs) do + if 0 == #sub.files then + print("EMPTY " .. name) + h = io.open(name .. '/index.md', 'w') + if nil ~= h then + h:write('This directory has no files.') + h:close() + else + print("Can't open " .. name .. '/index.md for writing.') + end + end +end --------------------------------------------------------------------------------- -- cgit v1.1