Files
OpenRA/interpreters/lua.lua
crazybutcher 15154050f9 Merge remote branch 'zbstudio/master'
Conflicts:
	cfg/config.lua
	doc/defs.lua
	estrela/config.lua
	src/editor/commands.lua
	src/editor/debugger.lua
	src/editor/filetree.lua
	src/editor/gui.lua
	src/editor/menu_file.lua
	src/editor/menu_project.lua
	src/editor/menu_tools.lua
	src/editor/menu_view.lua
	src/editor/output.lua
	src/editor/shellbox.lua
	src/editor/style.lua
	src/main.lua
2011-12-10 14:53:08 +01:00

22 lines
791 B
Lua

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