summaryrefslogtreecommitdiffstats
path: root/scripts/watch_content.sh
blob: 60f7b07de40c270bd1b547308481923f7ba469f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

inotifywait -rme create,close_write,delete,move --format "%w%f" content \
    | while read FILENAME
        do
            printf "Change detected: %s\n" "$FILENAME"
            if [ -f "$FILENAME" ]; then
                scripts/build_content.sh "$FILENAME"
            elif [ ! -d "$FILENAME" ]; then
                scripts/build_content.sh "$FILENAME" "delete"
            fi
        done