File: wrangle_paths.lua

package info (click to toggle)
luakit 1%3A2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,844 kB
  • sloc: ansic: 12,519; makefile: 140; ruby: 79; sh: 48
file content (22 lines) | stat: -rw-r--r-- 874 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- Test runner path wrangler.
--
-- @script async.wrangle_paths
-- @copyright 2017 Aidan Holm <aidanholm@gmail.com>

local system_paths, luakit_paths = {}, {}
for path in string.gmatch(package.path, "[^;]+") do
    if not path:match("^%./") and not path:find("luakit") then
        table.insert(system_paths, path)
    elseif not path:match("^%./") and path:find("luakit_test_") then
        table.insert(luakit_paths, path)
    end
end
local rel_paths = { "./lib/?.lua", "./lib/?/init.lua", "./config/?.lua", "./config/?/init.lua", }
system_paths = table.concat(system_paths, ";")
rel_paths = table.concat(rel_paths, ";")
luakit_paths = table.concat(luakit_paths, ";")
package.path = string.format("./?.lua;%s;%s;%s", system_paths, rel_paths, luakit_paths)

luakit.resource_path = "./resources" -- Don't use installed luakit when testing

-- vim: et:sw=4:ts=8:sts=4:tw=80