From c0bf4dd72275e11eb63068391ce9b393fbbc4906 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 13 Jul 2024 16:17:40 -0300 Subject: Refactor watch script to support 'kvmx inotify' and arbitrary guest VMs --- scripts/watch | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/watch b/scripts/watch index b0b3c50..a5aa653 100755 --- a/scripts/watch +++ b/scripts/watch @@ -9,11 +9,26 @@ DIRNAME="$(cd `dirname $0` &> /dev/null && pwd)" BASEDIR="$DIRNAME/.." WATCHED="docs" -# Got to the base folder +# Load existing .env file +if [ -e "$BASEDIR/.env" ]; then + source $BASEDIR/.env +fi + +# Configuration +FOLDER="${FOLDER:-/srv/shared}" +VM="${VM:-}" + +# Got to the base folder, to make sure an empty VM +# would resolve to the local kvmxfile cd $BASEDIR +# Built-in implementation +# # Dispatch -while inotifywait -r $WATCHED; do - #mkdocs build - kvmx ssh make -C /srv/shared compile -done +#while inotifywait -r $WATCHED; do +# #mkdocs build +# kvmx ssh $VM make -C $FOLDER compile +#done + +# Setup watcher +kvmx inotify $VM $WATCHED make -C $FOLDER compile -- cgit v1.2.3