feat: add more paths to package.path

pull/38/head
sammy 2021-04-09 18:22:05 -04:00
parent 2c711de9dc
commit 3523bfa28b
1 changed files with 4 additions and 1 deletions

5
lua.go
View File

@ -49,7 +49,10 @@ func LuaInit(confpath string) {
l.PreloadModule("bait", bait.Loader) l.PreloadModule("bait", bait.Loader)
// Add more paths that Lua can require from // Add more paths that Lua can require from
l.DoString("package.path = package.path .. ';./libs/?/init.lua;/usr/share/hilbish/libs/?/init.lua'") l.DoString(`package.path = package.path
.. ';./libs/?/init.lua;/usr/share/hilbish/libs/?/init.lua'
.. ';./?/init.lua;./?/?.lua'
`)
err := l.DoFile("/usr/share/hilbish/preload.lua") err := l.DoFile("/usr/share/hilbish/preload.lua")
if err != nil { if err != nil {