From c76b7a5519c18f3a8cf8e15a87ca94595d37e5d6 Mon Sep 17 00:00:00 2001 From: dvs1 Date: Sun, 22 Dec 2024 03:50:04 +1000 Subject: Merge directories if converting an external directory. --- notYetAnotherWiki.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/notYetAnotherWiki.lua b/notYetAnotherWiki.lua index e7f0873..0ee0f10 100755 --- a/notYetAnotherWiki.lua +++ b/notYetAnotherWiki.lua @@ -117,7 +117,17 @@ end local directory = arg[1] if nil == directory then directory = '.' end +local all = {} +if '.' ~= directory then + for l in io.popen('find . -name "*.md" -type f,l -printf "%P\n"'):lines() do + all[l] = l + end +end for l in io.popen('find ' .. directory .. ' -name "*.md" -type f,l -printf "%P\n"'):lines() do + if nil == all[l] then all[l] = l end +end + +for i, l in pairs(all) do local dir = '' local files, subs = {}, {} local c, parent = 1, '' -- cgit v1.1