mirror of
https://github.com/kepler155c/opus
synced 2025-12-21 07:38:06 +00:00
resizing + injector fixes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user