Skip to content

Commit

Permalink
next try on lua paths
Browse files Browse the repository at this point in the history
  • Loading branch information
lonvia committed Dec 5, 2024
1 parent d827f11 commit 41fbaa4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib-lua/flex-base.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
-- This is just an alias for the Nominatim themepark theme module
local flex = require('themes/nominatim/init')


function flex.load_topic(name, cfg)
local topic_file

if package.searchpath then
topic_file = package.searchpath('themes/nominatim/topics/' .. name, package.path)
else
topic_file = arg[0]:match("(.*/)") .. 'themes/nominatim/topics/'.. name .. '.lua'
topic_file = debug.getinfo(1, "S").source:sub(2):match("(.*/)") .. 'themes/nominatim/topics/'.. name .. '.lua'
end

loadfile(topic_file)(nil, flex, cfg or {})
Expand Down

0 comments on commit 41fbaa4

Please sign in to comment.