From 2c12447bac31cf5813a66408c6e1783ae5d02ca9 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Thu, 9 Jun 2022 08:43:47 +0300 Subject: [PATCH] adding colors --- bake | 6 +++--- testing/internals/Bakefile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bake b/bake index 8bc880b..4b726e3 100755 --- a/bake +++ b/bake @@ -1,5 +1,5 @@ #!/bin/bash -## VERSION 22.6.2 +## VERSION 22.6.8 ## BASH-MAKE ========================================================== ## Utility to mimick some of GNU Make behavior, but run in a single ## bash shell. This executable can be used as the Bakefile, too, @@ -114,7 +114,7 @@ _source_bakefile() { . "$BAKEFILE" fi; } _update_self() { - printf "Update %s => %s\n" \ + printf "\e[36mUpdate: %s ▶ %s\e[0m\n" \ "$( grep "^## VERSION" "$0" | awk '{ print $3 }' )" \ "$( curl -s -S -f \ "https://raw.githubusercontent.com/moonq/bake/main/bake" | \ @@ -124,7 +124,7 @@ _update_self() { chmod +x "$0" echo Updated. >&2 } -@() { echo +"$@" >&2; "$@"; } # Print command before running it +@() { printf "\e[36m▶ $@\e[0m\n" >&2; "$@"; } # Print command before running it for (( i=1; i<=$#; i++ )); do if [[ $i -eq 1 ]]; then diff --git a/testing/internals/Bakefile b/testing/internals/Bakefile index 5a0e6c0..6de9f7c 100644 --- a/testing/internals/Bakefile +++ b/testing/internals/Bakefile @@ -1,6 +1,6 @@ target1() { - echo 1 + @ echo 1 } target2() { # Target description # Sub help