Implement justfile watch mode
This commit is contained in:
parent
36427a41a4
commit
2726baa6bd
17
lua/justfile
17
lua/justfile
@ -1,11 +1,14 @@
|
||||
default:
|
||||
@just --list
|
||||
|
||||
teal_files := "main.tl framebuffer.tl ringbuffer.tl socket.tl"
|
||||
lua_files := `find . -type f -name "*.lua" ! -path './out/*' ! -name tlconfig.lua -printf "%p "`
|
||||
teal_files := `find . -type f -name "*.tl" ! -name '*.d.tl' -printf "%p "`
|
||||
|
||||
build:
|
||||
mkdir -p out
|
||||
cp json.lua out
|
||||
for file in {{lua_files}}; do \
|
||||
cp $file out; \
|
||||
done
|
||||
for file in {{teal_files}}; do \
|
||||
tl gen $file; \
|
||||
mv ${file%.tl}.lua out; \
|
||||
@ -16,4 +19,12 @@ alias b := build
|
||||
clean:
|
||||
rm -r out
|
||||
|
||||
alias c := clean
|
||||
alias c := clean
|
||||
|
||||
watch:
|
||||
while sleep 0.1; do \
|
||||
find . -type f ! -path './out/*' | entr -d just build; \
|
||||
[ $? -eq 0 ] && exit 0; \
|
||||
done
|
||||
|
||||
alias w := watch
|
Loading…
Reference in New Issue
Block a user