1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-12-28 10:18:22 +01:00
antd-web-apps/apps/controllers/ScriptController.lua
2018-09-22 19:11:40 +02:00

19 lines
444 B
Lua

BaseController:subclass("ScriptController", {
registry = {}
})
function ScriptController:index( name )
local path = WWW_ROOT..DIR_SEP.."assets"..DIR_SEP.."shs"..DIR_SEP..name..".sh"
if ulib.exists(path) then
std.header("text/plain")
std.f(path)
else
self:error("No script found")
end
return false
end
function ScriptController:actionnotfound(...)
return self:index(table.unpack({...}))
end