pure lua compatiblity fixes for moonlight, busted, etc

This commit is contained in:
kepler155c@gmail.com
2020-06-09 18:16:51 -06:00
parent 039fa73749
commit e9580d67eb
8 changed files with 133 additions and 73 deletions

View File

@@ -6,7 +6,7 @@ local fs = _G.fs
local settings = _G.settings
local shell = _ENV.shell
_G.requireInjector(_ENV)
--_G.requireInjector(_ENV)
local trace = require('opus.trace')
local Util = require('opus.util')
@@ -43,6 +43,11 @@ local function run(...)
local isUrl = not not command:match("^(https?:)")
local env = shell.makeEnv(_ENV)
if command:match('(.+)%.moon$') then
table.insert(args, 1, command)
command = 'moon'
end
local path, loadFn
if isUrl then
path = command