From 2c3ce58da993687f18ab7be22ca5aec91f3f1cb6 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Thu, 21 Nov 2024 12:37:29 +0100 Subject: [PATCH] gradle wrapper now works without unbuffer --- .aliases | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.aliases b/.aliases index 8f8fafc2..2fb7e74e 100644 --- a/.aliases +++ b/.aliases @@ -8,12 +8,20 @@ gradleWrapper () { return 1 fi - TEMPFILE=$(mktemp /tmp/gw.XXXXXX) - unbuffer ./gradlew "$@" | tee $TEMPFILE + if command -v unbuffer >/dev/null 2>&1; then + # if `unbuffer` is available in PATH, use it to print report file-URIs at the end + TEMPFILE=$(mktemp /tmp/gw.XXXXXX) + unbuffer ./gradlew "$@" | tee $TEMPFILE + echo + grep --color=never "Report:" $TEMPFILE + rm $TEMPFILE + else + # if `unbuffer` is not in PATH, simply run gradle + ./gradlew "$@" + echo "HINT: it's suggested to install 'unbuffer' to print report URIs at the end of a gradle run" + fi + - echo - grep --color=never "Report:" $TEMPFILE - rm $TEMPFILE } postgresAutodoc () {