Mercurial > prosody-hg
comparison util/paths.lua @ 10411:db2a06b9ff98
Merge 0.11->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 16 Nov 2019 16:52:31 +0100 |
| parents | 0971694b30a8 |
| children | 2ac63715ef6f |
comparison
equal
deleted
inserted
replaced
| 10410:659b577f280c | 10411:db2a06b9ff98 |
|---|---|
| 39 | 39 |
| 40 function path_util.join(...) | 40 function path_util.join(...) |
| 41 return t_concat({...}, path_sep); | 41 return t_concat({...}, path_sep); |
| 42 end | 42 end |
| 43 | 43 |
| 44 function path_util.complement_lua_path(installer_plugin_path) | |
| 45 -- Checking for duplicates | |
| 46 -- The commands using luarocks need the path to the directory that has the /share and /lib folders. | |
| 47 local lua_version = _VERSION:match(" (.+)$"); | |
| 48 local lua_path_sep = package.config:sub(3,3); | |
| 49 local dir_sep = package.config:sub(1,1); | |
| 50 local sub_path = dir_sep.."lua"..dir_sep..lua_version..dir_sep; | |
| 51 if not string.find(package.path, installer_plugin_path, 1, true) then | |
| 52 package.path = package.path..lua_path_sep..installer_plugin_path..dir_sep.."share"..sub_path.."?.lua"; | |
| 53 package.path = package.path..lua_path_sep..installer_plugin_path..dir_sep.."share"..sub_path.."?"..dir_sep.."init.lua"; | |
| 54 end | |
| 55 if not string.find(package.path, installer_plugin_path, 1, true) then | |
| 56 package.cpath = package.cpath..lua_path_sep..installer_plugin_path..dir_sep.."lib"..sub_path.."?.so"; | |
| 57 end | |
| 58 end | |
| 59 | |
| 44 return path_util; | 60 return path_util; |
