diff options
author | sanine <sanine.not@pm.me> | 2022-01-05 15:32:55 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-01-05 15:32:55 -0600 |
commit | 0f4ebe27d2820c32ed7df74d4be8912bd73a53ac (patch) | |
tree | 14d2a2659debefaf96db4a23cace163d9ce1f028 | |
parent | 590601d810b5a810f87aa9b37ed31d8e7e43063d (diff) |
set plugin directory before loading layouts
-rw-r--r-- | src/lua-script/script.h | 12 | ||||
-rw-r--r-- | src/lua-script/script.lua | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/lua-script/script.h b/src/lua-script/script.h index 1ba2e4b..cf64d22 100644 --- a/src/lua-script/script.h +++ b/src/lua-script/script.h @@ -250,6 +250,12 @@ const char *argent_script = " argent.log('info', 'noprocess: '..set_tostring(argent.config.noprocess))\n" " argent.log('info', 'rss files: '..set_tostring(argent.config.rss_include))\n" "\n" + " if argent.config.plugin_directory then\n" + " package.path =\n" + " add_end_slash(argent.currentWorkingDirectory())\n" + " ..argent.config.plugin_directory..'?.lua;'..package.path\n" + " end\n" + "\n" " if argent.config.layout_directory then\n" " argent.layouts = load_layouts()\n" " else\n" @@ -257,12 +263,6 @@ const char *argent_script = " end\n" " argent.log('info', fmt('available layouts: %s', set_tostring(argent.layouts)))\n" " \n" - " if argent.config.plugin_directory then\n" - " package.path =\n" - " add_end_slash(argent.currentWorkingDirectory())\n" - " ..argent.config.plugin_directory..'?.lua;'..package.path\n" - " end\n" - "\n" " if argent.config.rss_include then\n" " if not argent.config.site_address then\n" " error('rss_include is set, but site_address is not!')\n" diff --git a/src/lua-script/script.lua b/src/lua-script/script.lua index 2e896ae..e0ecb4d 100644 --- a/src/lua-script/script.lua +++ b/src/lua-script/script.lua @@ -249,6 +249,12 @@ return function(config) argent.log('info', 'noprocess: '..set_tostring(argent.config.noprocess)) argent.log('info', 'rss files: '..set_tostring(argent.config.rss_include)) + if argent.config.plugin_directory then + package.path = + add_end_slash(argent.currentWorkingDirectory()) + ..argent.config.plugin_directory..'?.lua;'..package.path + end + if argent.config.layout_directory then argent.layouts = load_layouts() else @@ -256,12 +262,6 @@ return function(config) end argent.log('info', fmt('available layouts: %s', set_tostring(argent.layouts))) - if argent.config.plugin_directory then - package.path = - add_end_slash(argent.currentWorkingDirectory()) - ..argent.config.plugin_directory..'?.lua;'..package.path - end - if argent.config.rss_include then if not argent.config.site_address then error('rss_include is set, but site_address is not!') |