feat(cli): ags run naive --watch mode
Hi !
Most of the code and ideas are retrieved from https://github.com/Aylur/ags/pull/634
With the difference of using esbuild watch mode in an attempt to delegate cache invalidation to the builder.
First time writing go, so please review with caution :)
Hi @Aylur, Thanks a lot for your work on ags and astal :)
Maybe this PR can help with the watch mode request ? Have a great day !
While this is pending for merge, I'm using this workaround to get working live reload: (This is in Justfile syntax, but it can be used in a bash script with minimal changes)
run:
@while true; do \
echo "Starting the bar..."; \
ags run --gtk4 . & \
echo "Bar started, waiting for file changes..."; \
inotifywait -q -r -e modify,move,create,delete .; \
echo "File change detected. Killing bar"; \
pkill ags; \
pkill gjs; \
done
naive full restart is not planned see https://github.com/Aylur/ags/issues/724