Comparison

util/pluginloader.lua @ 10210:9fdda9fafc3c

Merge mod-installer (2019 GSoC by João Duarte)
author Matthew Wild <mwild1@gmail.com>
date Mon, 19 Aug 2019 12:17:17 +0100
parent 10205:ff8de86b75f0
child 11129:387d442497e7
comparison
equal deleted inserted replaced
10121:33f287519bf6 10210:9fdda9fafc3c
34 return file, err; 34 return file, err;
35 end 35 end
36 36
37 local function load_resource(plugin, resource) 37 local function load_resource(plugin, resource)
38 resource = resource or "mod_"..plugin..".lua"; 38 resource = resource or "mod_"..plugin..".lua";
39 39 local lua_version = _VERSION:match(" (.+)$");
40 local names = { 40 local names = {
41 "mod_"..plugin..dir_sep..plugin..dir_sep..resource; -- mod_hello/hello/mod_hello.lua 41 "mod_"..plugin..dir_sep..plugin..dir_sep..resource; -- mod_hello/hello/mod_hello.lua
42 "mod_"..plugin..dir_sep..resource; -- mod_hello/mod_hello.lua 42 "mod_"..plugin..dir_sep..resource; -- mod_hello/mod_hello.lua
43 plugin..dir_sep..resource; -- hello/mod_hello.lua 43 plugin..dir_sep..resource; -- hello/mod_hello.lua
44 resource; -- mod_hello.lua 44 resource; -- mod_hello.lua
45 "share"..dir_sep.."lua"..dir_sep..lua_version..dir_sep.."mod_"..plugin..dir_sep..resource;
45 }; 46 };
46 47
47 return load_file(names); 48 return load_file(names);
48 end 49 end
49 50