diff options
| author | dvs1 | 2024-12-22 03:50:04 +1000 |
|---|---|---|
| committer | dvs1 | 2024-12-22 03:50:04 +1000 |
| commit | c76b7a5519c18f3a8cf8e15a87ca94595d37e5d6 (patch) | |
| tree | b88d924eef0897287b236550d9a41f798fd7987b | |
| parent | Try it the other way, cgit is fussy about it's README. (diff) | |
| download | notYetAnotherWiki-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-x | notYetAnotherWiki.lua | 10 |
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 | ||
| 118 | local directory = arg[1] | 118 | local directory = arg[1] |
| 119 | if nil == directory then directory = '.' end | 119 | if nil == directory then directory = '.' end |
| 120 | local all = {} | ||
| 121 | if '.' ~= 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 | ||
| 125 | end | ||
| 120 | for l in io.popen('find ' .. directory .. ' -name "*.md" -type f,l -printf "%P\n"'):lines() do | 126 | for 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 | ||
| 128 | end | ||
| 129 | |||
| 130 | for 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, '' |
