Move to Teal 🚀 #6
8
justfile
8
justfile
|
@ -1,6 +1,8 @@
|
|||
lua_version := "5.4"
|
||||
lua := "lua" + " -l set_paths"
|
||||
|
||||
tl := "tl run" + " -l set_paths"
|
||||
|
||||
rocks_tree := "lua_modules"
|
||||
rockspec_file := "rockspecs/awesomewm.d.tl-dev-1.rockspec"
|
||||
|
||||
|
@ -36,8 +38,12 @@ clean:
|
|||
rm -rf build
|
||||
|
||||
run:
|
||||
{{ lua }} build/awesomewm.d.tl/init.lua
|
||||
{{ tl }} src/awesomewm.d.tl/init.tl
|
||||
|
||||
# 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 --gen-compat "off" 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,3 @@
|
|||
-- set_paths.lua
|
||||
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