mirror of
https://github.com/lxsang/antd-web-apps
synced 2024-11-20 10:18:21 +01:00
19 lines
444 B
Lua
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 |