|
On Fri, May 11, 2012 at 12:52 PM, steve donovanAlthough I think it really is an odd case; arg[-1] only really makes
<steve.j.donovan@gmail.com> wrote:
> gluing step. I can reproduce this with a glued soar.exe and yes it is
> a bug.
sense for Lua programs.
One fix (around line 477 of soar.lua)
this
if not scriptname then usage("no scriptname provided") end
local lua = arg[-1]
becomes
if not scriptname then usage("no scriptname provided") end
local lua = arg[-1] or 'lua'
Another approach is to use the packaged soar, just as a Lua script:
D:\dev\lua\luabuild>lua tools\soar.lua -s -o soar tools\soar.lua
_main tools\soar.lua
ml C:\Program Files\Lua\5.1\lua\ml.lua
---- binary dependencies ---
batch file written to: soar.bat
output written to: soar-all.lua
That is, you can then use soar.bat to do the same job.
Actually, if your project.lua does not any other Lua modules, then you
can glue it directly.
D:\dev\lua\luabuild>copy con test.lua
local lfs = require 'lfs'
print(lfs.currentdir())
^Z
1 file(s) copied.
D:\dev\lua\luabuild>set PATH=d:\dev\lua\luabuild\bin;%PATH%
D:\dev\lua\luabuild>srlua -m lfs test.lua
d:\dev\lua\luabuild\bin\glue.exe
d:\dev\lua\luabuild\bin\srluab\lua-lfs.exe test.lua test.exe
Note the '-m lfs' tells srlua to include LuaFileSystem
steve d.