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