aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authordvs12024-12-22 03:50:04 +1000
committerdvs12024-12-22 03:50:04 +1000
commitc76b7a5519c18f3a8cf8e15a87ca94595d37e5d6 (patch)
treeb88d924eef0897287b236550d9a41f798fd7987b
parentTry it the other way, cgit is fussy about it's README. (diff)
downloadnotYetAnotherWiki-c76b7a5519c18f3a8cf8e15a87ca94595d37e5d6.zip
notYetAnotherWiki-c76b7a5519c18f3a8cf8e15a87ca94595d37e5d6.tar.gz
notYetAnotherWiki-c76b7a5519c18f3a8cf8e15a87ca94595d37e5d6.tar.bz2
notYetAnotherWiki-c76b7a5519c18f3a8cf8e15a87ca94595d37e5d6.tar.xz
Merge directories if converting an external directory.
Diffstat (limited to '')
-rwxr-xr-xnotYetAnotherWiki.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/notYetAnotherWiki.lua b/notYetAnotherWiki.lua
index e7f0873..0ee0f10 100755
--- a/notYetAnotherWiki.lua
+++ b/notYetAnotherWiki.lua
@@ -117,7 +117,17 @@ end
117 117
118local directory = arg[1] 118local directory = arg[1]
119if nil == directory then directory = '.' end 119if nil == directory then directory = '.' end
120local all = {}
121if '.' ~= directory then
122 for l in io.popen('find . -name "*.md" -type f,l -printf "%P\n"'):lines() do
123 all[l] = l
124 end
125end
120for l in io.popen('find ' .. directory .. ' -name "*.md" -type f,l -printf "%P\n"'):lines() do 126for l in io.popen('find ' .. directory .. ' -name "*.md" -type f,l -printf "%P\n"'):lines() do
127 if nil == all[l] then all[l] = l end
128end
129
130for i, l in pairs(all) do
121 local dir = '' 131 local dir = ''
122 local files, subs = {}, {} 132 local files, subs = {}, {}
123 local c, parent = 1, '' 133 local c, parent = 1, ''