Files
OpenRA/interpreters/lua.lua
2011-03-06 14:37:44 +01:00

22 lines
750 B
Lua

return {
name = "Lua",
description = "Commandline Lua interpreter",
api = {"wx","baselib"},
fcmdline = function(filepath)
local mainpath = ide.editorFilename:gsub("[^/\\]+$","")
local code = ([[
xpcall(function() dofile '%s' end,
function(err) print(debug.traceback(err)) end)
]]):format(filepath:gsub("\\","/"))
return '"'..mainpath..'/bin/lua.exe" -e "'..code..'"'
end,
fprojdir = function(fname)
return fname:GetPath(wx.wxPATH_GET_VOLUME)
end,
capture = true,
fworkdir = function (filepath)
return ide.config.path.projectdir and ide.config.path.projectdir:len()>0 and
ide.config.path.projectdir
end,
--return filepath and filepath:gsub("[\\/]+$","") end,
}