-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile_watcher.sh
More file actions
50 lines (42 loc) · 1.09 KB
/
file_watcher.sh
File metadata and controls
50 lines (42 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
if [ -z "$(which inotifywait)" ]; then
echo "inotifywait not installed."
echo "In most distros, it is available in the inotify-tools package."
exit 1
fi
counter=0;
function execute() {
counter=$((counter+1))
echo $counter
bash start_gen.sh
eval "$@"
}
# inotifywait --recursive --monitor --format "%e %w%f" \
# --event modify \
# --exclude .git/ \
# --exclude .venv/ \
# --exclude content/ \
# --exclude content/.org_gen \
# --exclude generated/ \
# ./ \
# | while read changed; do
# echo $changed
# execute "$@"
# done &
echo "Setup content watch"
inotifywait --recursive --monitor --format "%e %w%f" \
--event modify \
--exclude content/.org_gen \
content \
| while read changed; do
echo $changed
execute "$@"
done &
echo "Setup template watch"
inotifywait --recursive --monitor --format "%e %w%f" \
--event modify \
templates \
| while read changed; do
echo $changed
execute "$@"
done