ignition/butane-watch.sh

10 lines
260 B
Bash

#!/bin/sh
# vim: set sw=4 ts=4 sts=4 et :
inotifywait -e CLOSE_WRITE -m . \
| stdbuf -o 0 grep -F .yaml \
| while read _ _ f; do
printf 'Regenerating %s from %s ...\n' "${f%.yaml}.ign" "${f}"
butane -d . ${f} > ${f%.yaml}.ign
done