Added in ability to have `init.so` as a require for cpath. (#1126)

This commit is contained in:
Adam 2022-09-25 17:08:21 -04:00 committed by GitHub
parent 9f1294fea2
commit 6bb08fc68f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions

View File

@ -22,9 +22,16 @@ package.path = USERDIR .. '/?.lua;' .. package.path
package.path = USERDIR .. '/?/init.lua;' .. package.path
local suffix = PLATFORM == "Mac OS X" and 'lib' or (PLATFORM == "Windows" and 'dll' or 'so')
package.cpath = USERDIR .. '/?.' .. ARCH .. "." .. suffix .. ";" .. DATADIR .. '/?.' .. ARCH .. "." .. suffix ..
USERDIR .. '/?.' .. suffix .. ";" .. DATADIR .. '/?.' .. suffix
package.cpath =
USERDIR .. '/?.' .. ARCH .. "." .. suffix .. ";" ..
USERDIR .. '/?/init.' .. ARCH .. "." .. suffix .. ";" ..
USERDIR .. '/?.' .. suffix .. ";" ..
USERDIR .. '/?/init.' .. suffix .. ";" ..
DATADIR .. '/?.' .. ARCH .. "." .. suffix ..
DATADIR .. '/?/init.' .. ARCH .. "." .. suffix ..
DATADIR .. '/?.' .. suffix ..
DATADIR .. '/?/init.' .. suffix
package.native_plugins = {}
package.searchers = { package.searchers[1], package.searchers[2], function(modname)
local path = package.searchpath(modname, package.cpath)