Skip to content

Commit

Permalink
Extend default Lua package path
Browse files Browse the repository at this point in the history
The default Lua package path has been extended with a new location. The function `PackagePath` in `packagepath.go` now also includes the path "/usr/app/lua-plugins.d/share/?.lua" by default. This provides an additional location to source Lua scripts for the application.

Signed-off-by: Christian Roessner <[email protected]>
  • Loading branch information
Christian Roessner committed Jul 23, 2024
1 parent ac071a4 commit 917b662
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/lualib/packagepath.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// It appends the Lua package path with the value returned by `config.LoadableConfig.GetLuaPackagePath()`.
// This function takes a Lua state (`*lua.LState`) as an argument and returns an error.
func PackagePath(L *lua.LState) error {
defaultPath := "/usr/local/share/nauthilus/lua/?.lua;/usr/share/nauthilus/lua/?.lua;"
defaultPath := "/usr/local/share/nauthilus/lua/?.lua;/usr/share/nauthilus/lua/?.lua;/usr/app/lua-plugins.d/share/?.lua"

return L.DoString(fmt.Sprintf(`package.path = package.path .. ';%s;%s'`, defaultPath, config.LoadableConfig.GetLuaPackagePath()))
}

0 comments on commit 917b662

Please sign in to comment.