diff options
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 | --------------------------------------------------------------------------------- |