feat: add hilbish native module loader to package searcher

native-modules
sammyette 2023-07-10 23:20:28 -04:00
parent 42446fbf57
commit 6d936506c8
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 9 additions and 0 deletions

View File

@ -5,6 +5,15 @@ local fs = require 'fs'
package.path = package.path .. ';' .. hilbish.dataDir .. '/?/init.lua' package.path = package.path .. ';' .. hilbish.dataDir .. '/?/init.lua'
.. ';' .. hilbish.dataDir .. '/?/?.lua' .. ";" .. hilbish.dataDir .. '/?.lua' .. ';' .. hilbish.dataDir .. '/?/?.lua' .. ";" .. hilbish.dataDir .. '/?.lua'
hilbish.module.paths = '?.so;?/?.so'
table.insert(package.searchers, function(module)
local path = package.searchpath(module, hilbish.module.paths)
if not path then return nil end
-- it didnt work normally, idk
return function() return hilbish.module.load(path) end, path
end)
require 'nature.commands' require 'nature.commands'
require 'nature.completions' require 'nature.completions'