Files
ignition/butane-watch.sh
Dustin C. Hatch 2a0b23c9a8 meta: Add Makefile
When developing Butane/Ignition files, I frequently forget to update the
parent files after making a change to an included file.  This causes a
lot of wasted time re-provisioning, only to discover that my change
did not take effect.  To alleviate this, we'll use `make` with some
macro magic to scan the Butane files for their dependencies, and let it
generate whatever Ignition files need updating any time a dependant file
changes.

I've also added a "publish" step to the Makefile, since I also
frequently forget to upload the regenerated Ignition files to the
server, causing the same headaches.
2023-09-16 08:15:08 -05:00

11 lines
264 B
Bash

#!/bin/sh
# vim: set sw=4 ts=4 sts=4 et :
inotifywait -e CLOSE_WRITE -m . \
| stdbuf -o 0 grep -v .ign \
| while read _ _ f; do
[ -f "${f}" ] || continue
printf '%s changed, running make ...\n' "${f}"
make && make publish
done