Patched a bug with require
If there was a folder in root with the same name as a library, requiring that library would cause the require function to error. This has now been fixed.
This commit is contained in:
@@ -35,14 +35,17 @@ function _G.reqgen(load)
|
||||
return package.preloaded[module]
|
||||
end
|
||||
local modulepath
|
||||
if filesystem.exists(module) then
|
||||
if filesystem.exists(module) and not filesystem.isDirectory(module) then
|
||||
modulepath = module
|
||||
elseif filesystem.exists("/lib/" .. module .. ".lua") then
|
||||
elseif
|
||||
filesystem.exists("/lib/" .. module .. ".lua") and not filesystem.isDirectory("/lib/" .. module .. ".lua")
|
||||
then
|
||||
modulepath = "/lib/" .. module .. ".lua"
|
||||
elseif
|
||||
shell
|
||||
and shell.workingDirectory
|
||||
and filesystem.exists(filesystem.concat(shell.workingDirectory, module .. ".lua"))
|
||||
shell
|
||||
and shell.workingDirectory
|
||||
and filesystem.exists(filesystem.concat(shell.workingDirectory, module .. ".lua"))
|
||||
and not filesystem.isDirectory(filesystem.concat(shell.workingDirectory, module .. ".lua"))
|
||||
then
|
||||
modulepath = shell.workingDirectory .. module .. ".lua"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user