summaryrefslogtreecommitdiff
path: root/posix-shell
diff options
context:
space:
mode:
Diffstat (limited to 'posix-shell')
-rw-r--r--posix-shell/utils.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/posix-shell/utils.sh b/posix-shell/utils.sh
index b21c09b..0d71901 100644
--- a/posix-shell/utils.sh
+++ b/posix-shell/utils.sh
@@ -276,3 +276,26 @@ hexdiff() {
rm -f "$dump1" "$dump2"
}
+
+automeson() {
+ if test "$#" -ne 2
+ then
+ echo "Usage: automeson <build-dir> <file-to-watch>"
+ return 1
+ fi
+
+ build="$1"
+ file="$2"
+
+ while true
+ do
+ inotifywait --quiet --event close_write "$file"
+ clear
+ if meson compile -C "$build"
+ then
+ printf '\033[32mOK\033[0m\n'
+ else
+ printf '\033[31mFAILED\033[0m\n'
+ fi
+ done
+}