aboutsummaryrefslogtreecommitdiffstats
path: root/util
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
commitb0616dd198c00f823dd982a80781787d98166cbe (patch)
treedc31dbcfbba7ba419b0afb247182133fe55afd66 /util
parentf875b6f99c458a0e1d6a6e784761ed255f369b22 (diff)
downloadprosody-b0616dd198c00f823dd982a80781787d98166cbe.tar.gz
prosody-b0616dd198c00f823dd982a80781787d98166cbe.zip
util.pluginloader: Extract Lua version once
It's not going to change while the module is loaded.
Diffstat (limited to 'util')
-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