fixup! run(justfile): run recipe run sources with Teal
This commit is contained in:
parent
7451672ed4
commit
7968d122b1
4
justfile
4
justfile
|
@ -43,3 +43,7 @@ run:
|
|||
# TODO : how to run a debugger on Teal code?
|
||||
debug:
|
||||
{{ lua }} debug.lua build/awesomewm.d.tl/init.lua
|
||||
debug-gen:
|
||||
cyan gen --output set_paths.lua set_paths.tl
|
||||
sed -i 's/"src\/awesomewm.d.tl"/"build\/awesomewm.d.tl"/g' set_paths.lua
|
||||
stylua set_paths.lua
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
-- set_paths.lua
|
||||
local _tl_compat
|
||||
if (tonumber((_VERSION or ""):match "[%d.]*$") or 0) < 5.3 then
|
||||
local p, m = pcall(require, "compat53.module")
|
||||
if p then
|
||||
_tl_compat = m
|
||||
end
|
||||
end
|
||||
local package = _tl_compat and _tl_compat.package or package
|
||||
local string = _tl_compat and _tl_compat.string or string
|
||||
local version = _VERSION:match "%d+%.%d+"
|
||||
|
||||
local function lua_module_paths(module_base_path)
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
-- set_paths.lua
|
||||
local version = _VERSION:match "%d+%.%d+"
|
||||
|
||||
local function lua_module_paths(module_base_path: string): string
|
||||
local paths = (module_base_path .. "/?.lua;")
|
||||
.. (module_base_path .. "/?/init.lua;")
|
||||
|
||||
return paths
|
||||
end
|
||||
|
||||
package.path = lua_module_paths("lua_modules/share/lua/" .. version)
|
||||
.. lua_module_paths "types"
|
||||
.. lua_module_paths "build/awesomewm.d.tl"
|
||||
.. package.path
|
||||
|
||||
package.cpath = "lua_modules/lib/lua/" .. version .. "/?.so;" .. package.cpath
|
Loading…
Reference in New Issue