1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-11-20 10:18:21 +01:00
antd-web-apps/apps/controllers/ScriptController.lua

19 lines
444 B
Lua
Raw Normal View History

2018-09-22 19:11:40 +02:00
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