-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaths.lua
31 lines (25 loc) · 882 Bytes
/
paths.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
local gears = require("gears")
local config_dir = gears.filesystem.get_configuration_dir()
-- The 5.2 modules will sometimes work for us,
-- but we need to use the real version for the cpath
local version = '5.2'
local realVersion = _VERSION:match("%d+%.%d+")
local paths = {
'./?.lua',
'./?/init.lua',
'lua_modules/share/lua/' .. version .. '/?.lua',
'lua_modules/share/lua/' .. version .. '/?/init.lua',
config_dir .. '?.lua',
config_dir ..'?/init.lua',
config_dir .. 'lua_modules/share/lua/' .. version .. '/?.lua',
config_dir .. 'lua_modules/share/lua/' .. version .. '/?/init.lua'
}
local cpaths = {
config_dir .. 'lua_modules/lib/lua/' .. realVersion .. '/?.so'
}
for _, path in ipairs(paths) do
package.path = package.path .. ';' .. path
end
for _, path in ipairs(cpaths) do
package.cpath = package.cpath .. ';' .. path
end