[+] Script to restart when files change

This commit is contained in:
Azalea Gui
2023-03-08 09:46:50 -05:00
parent b391877019
commit 9b29f7ed06
2 changed files with 17 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
/target
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
sigint_handler()
{
kill $PID
exit
}
trap sigint_handler SIGINT
while true; do
cargo run &
PID=$!
inotifywait -e modify -e move -e create -e delete -e attrib -r `pwd` --include '.*\.rs'
kill $PID
done