1
0
This commit is contained in:
2026-05-12 20:00:01 +02:00
parent 1ac05decbd
commit 4869d575af
2 changed files with 25 additions and 1 deletions

24
watch.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
cd "$(dirname "$0")"
run_converter() {
bash ./convert-md.sh
}
python3 -m http.server 8000 &
SERVER_PID=$!
cleanup() {
echo "Stopping server (PID: $SERVER_PID)..."
kill $SERVER_PID 2>/dev/null
exit 0
}
trap cleanup SIGINT SIGTERM
run_converter
inotifywait -m -e modify -e create -e delete --include '\.md$' -r . 2>/dev/null | while read -r path event file; do
echo "Change detected: $event on $path$file"
run_converter
done