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

source "site.defaults.conf"

inotifywait -qrme close_write,delete,move --format "%w%f" "${CONTENT_DIR%/}" \
    | while read file
        do
            if [ -f "$file" ]; then
                # scripts/build_content.sh "single" "$file"
                scripts/build_content.sh
            elif [ ! -d "$file" ]; then
                scripts/build_content.sh "delete" "$file"
            fi
        done