diff options
author | Kim Alvefur <zash@zash.se> | 2020-10-05 20:56:03 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-10-05 20:56:03 +0200 |
commit | b0616dd198c00f823dd982a80781787d98166cbe (patch) | |
tree | dc31dbcfbba7ba419b0afb247182133fe55afd66 /util | |
parent | f875b6f99c458a0e1d6a6e784761ed255f369b22 (diff) | |
download | prosody-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.lua | 2 |
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 |