mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-02 12:47:49 +02:00
13 lines
260 B
Lua
13 lines
260 B
Lua
-- Require a module only when it can be found on package.path.
|
|
-- Errors inside existing modules still surface normally.
|
|
|
|
local M = {}
|
|
|
|
function M.module(module)
|
|
if package.searchpath(module, package.path) then
|
|
return require(module)
|
|
end
|
|
end
|
|
|
|
return M
|