aboutsummaryrefslogtreecommitdiffstats
path: root/util/pluginloader.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-10-05 20:56:03 +0200
committerKim Alvefur <zash@zash.se>2020-10-05 20:56:03 +0200
commit753ba4a8f2dbb2fe7d25121fafa28180ea3d6972 (patch)
treedc31dbcfbba7ba419b0afb247182133fe55afd66 /util/pluginloader.lua
parent937336bacd199e30b999831cb71c6255a35cb06f (diff)
downloadprosody-753ba4a8f2dbb2fe7d25121fafa28180ea3d6972.tar.gz
prosody-753ba4a8f2dbb2fe7d25121fafa28180ea3d6972.zip
util.pluginloader: Extract Lua version once
It's not going to change while the module is loaded.
Diffstat (limited to 'util/pluginloader.lua')
-rw-r--r--util/pluginloader.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/pluginloader.lua b/util/pluginloader.lua
index af0428c4..1cebe436 100644
--- a/util/pluginloader.lua
+++ b/util/pluginloader.lua
@@ -8,6 +8,7 @@
-- luacheck: ignore 113/CFG_PLUGINDIR
local dir_sep, path_sep = package.config:match("^(%S+)%s(%S+)");
+local lua_version = _VERSION:match(" (.+)$");
local plugin_dir = {};
for path in (CFG_PLUGINDIR or "./plugins/"):gsub("[/\\]", dir_sep):gmatch("[^"..path_sep.."]+") do
path = path..dir_sep; -- add path separator to path end
@@ -36,7 +37,6 @@ end
local function load_resource(plugin, resource)
resource = resource or "mod_"..plugin..".lua";
- local lua_version = _VERSION:match(" (.+)$");
local names = {
"mod_"..plugin..dir_sep..plugin..dir_sep..resource; -- mod_hello/hello/mod_hello.lua
"mod_"..plugin..dir_sep..resource; -- mod_hello/mod_hello.lua