diff options
| author | dvs1 | 2025-03-16 13:33:44 +1000 | 
|---|---|---|
| committer | dvs1 | 2025-03-16 13:33:44 +1000 | 
| commit | 2eaee0eba05a703234563417d674bc2e4a7b4e96 (patch) | |
| tree | a6eec24d5181148921307d5d35f5cd277aa4dd8c /notYetAnotherWiki.lua | |
| parent | Don't hide the left menu, now that it contains headings. (diff) | |
| download | notYetAnotherWiki-2eaee0eba05a703234563417d674bc2e4a7b4e96.zip notYetAnotherWiki-2eaee0eba05a703234563417d674bc2e4a7b4e96.tar.gz notYetAnotherWiki-2eaee0eba05a703234563417d674bc2e4a7b4e96.tar.bz2 notYetAnotherWiki-2eaee0eba05a703234563417d674bc2e4a7b4e96.tar.xz  | |
Deal with complex directory trees.
Just do the simple thing, drop a file in it so it's not empty.
Diffstat (limited to 'notYetAnotherWiki.lua')
| -rwxr-xr-x | notYetAnotherWiki.lua | 13 | 
1 files changed, 13 insertions, 0 deletions
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 | |||
| 430 | end | 430 | end | 
| 431 | end | 431 | end | 
| 432 | 432 | ||
| 433 | -- Find empty subs. | ||
| 434 | for name, sub in pairs(Subs) do | ||
| 435 | if 0 == #sub.files then | ||
| 436 | print("EMPTY " .. name) | ||
| 437 | h = io.open(name .. '/index.md', 'w') | ||
| 438 | if nil ~= h then | ||
| 439 | h:write('This directory has no files.') | ||
| 440 | h:close() | ||
| 441 | else | ||
| 442 | print("Can't open " .. name .. '/index.md for writing.') | ||
| 443 | end | ||
| 444 | end | ||
| 445 | end | ||
| 433 | 446 | ||
| 434 | 447 | ||
| 435 | --------------------------------------------------------------------------------- | 448 | --------------------------------------------------------------------------------- | 
