fix: check and print module isnt found instead of failing

dev
TorchedSammy 2021-11-22 19:20:22 -05:00
parent 179947cd98
commit f741c2709c
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 4 additions and 0 deletions

View File

@ -72,6 +72,10 @@ These are the global Hilbish functions that are always available and not part of
subdocName = 'index'
end
f = io.open(moddocPath .. subdocName .. '.txt', 'rb')
if not f then
print('No documentation found for ' .. mod .. '.')
return
end
funcdocs = f:read '*a'
local subdocs = table.map(fs.readdir(moddocPath), function(f)
return lunacolors.underline(lunacolors.blue(string.gsub(f, '.txt', '')))