]> gitweb.fluxo.info Git - templates.git/commitdiff
Refactor watch script to support 'kvmx inotify' and arbitrary guest VMs
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 13 Jul 2024 19:17:40 +0000 (16:17 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 13 Jul 2024 19:17:40 +0000 (16:17 -0300)
.gitignore
scripts/watch

index 05d02cce3a943a9cdac0a56ffafb8d304d04febb..3d268f5ad4d696cca0e5a65cbf729be9b4ed637f 100644 (file)
@@ -3,3 +3,4 @@ _static/templates.epub
 _static/templates.pdf
 site
 .cache
+.env
index b0b3c508c371a9572f8f639a1a2ac4dff73bdbdf..a5aa6535d6afda9f0d4971d90d6b2e3c7061254f 100755 (executable)
@@ -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