/ de-omarchy / default / hypr / require_optional.lua
swadhinbiswas Initial de-omarchy: Omarchy UI layer for Arch-based distros · 8/22/2026
9f393b2
13 lines · 260 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
-- 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