1
0
mirror of https://github.com/kepler155c/opus synced 2025-12-21 07:38:06 +00:00

resizing + injector fixes

This commit is contained in:
kepler155c@gmail.com
2019-02-08 19:21:20 -05:00
parent 72b3c7bac9
commit 8c1abb21ca
10 changed files with 59 additions and 33 deletions

View File

@@ -103,17 +103,21 @@ return function(env)
local sPath = string.gsub(pattern, "%?", fname)
-- TODO: if there's no shell, we should not be checking relative paths below
-- as they will resolve to root directory
if env.shell and type(env.shell.getRunningProgram) == 'function' and sPath:sub(1, 1) ~= "/" then
sPath = fs.combine(fs.getDir(env.shell.getRunningProgram() or ''), sPath)
end
if fs.exists(sPath) and not fs.isDir(sPath) then
return loadfile(sPath, env)
elseif sPath:match("^(https?:)") then
print('loading ' .. sPath)
if sPath:match("^(https?:)") then
local c = loadUrl(sPath)
if c then
return load(c, modname, nil, env)
end
else
if env.shell and
type(env.shell.getRunningProgram) == 'function' and
sPath:sub(1, 1) ~= "/" then
sPath = fs.combine(fs.getDir(env.shell.getRunningProgram() or ''), sPath)
end
if fs.exists(sPath) and not fs.isDir(sPath) then
return loadfile(sPath, env)
end
end
end
end