transparent compatiblity for moonscript

This commit is contained in:
kepler155c@gmail.com
2020-06-10 19:46:34 -06:00
parent 4f39604c63
commit 2fdcc338ad
4 changed files with 64 additions and 32 deletions

View File

@@ -13,13 +13,12 @@ Util.merge(env, _ENV)
env._G = env
env.arg = { ... }
env.arg[0] = shell.resolveProgram(table.remove(env.arg, 1))
env.arg[0] = shell.resolveProgram(table.remove(env.arg, 1) or error('file name is required'))
_G.requireInjector(env, fs.getDir(env.arg[0]))
local s, m = Util.run(env, env.arg[0], table.unpack(env.arg))
if not s then
error(m)
error(m, -1)
end