From 9c16b1af538dd3b409c8bfb5fa31ae7edf4fcc7a Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Fri, 10 Jun 2022 15:52:20 +0300 Subject: [PATCH] fixing echoing bug --- bake | 4 ++-- testing/Bakefile | 4 ++-- testing/internals/Bakefile | 9 ++++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/bake b/bake index 4b726e3..9d28f41 100755 --- a/bake +++ b/bake @@ -1,5 +1,5 @@ #!/bin/bash -## VERSION 22.6.8 +## VERSION 22.6.10 ## 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, @@ -124,7 +124,7 @@ _update_self() { chmod +x "$0" echo Updated. >&2 } -@() { printf "\e[36m▶ $@\e[0m\n" >&2; "$@"; } # Print command before running it +@() { echo "▶ $@" >&2; "$@"; } # Print command before running it for (( i=1; i<=$#; i++ )); do if [[ $i -eq 1 ]]; then diff --git a/testing/Bakefile b/testing/Bakefile index fe347af..b713510 100644 --- a/testing/Bakefile +++ b/testing/Bakefile @@ -2,9 +2,9 @@ BAKE=$( readlink -f ../bake ) internals() { _yecho "flines function" - _assert_eq "$( cd internals; $BAKE flines | wc -l )" "4" + _assert_eq "$( cd internals; $BAKE flines | wc -l )" "5" _yecho "commands function" - _assert_eq "$( cd internals; $BAKE commands )" "^target1$|^target2$|^flines$|^commands$" + _assert_eq "$( cd internals; $BAKE commands )" "^target1$|^target2$|^flines$|^commands$|^echoing$" _yecho "Not a target should fail" ( cd internals; $BAKE non-existent ) && { _fail; } || { _pass; } diff --git a/testing/internals/Bakefile b/testing/internals/Bakefile index 6de9f7c..f96192f 100644 --- a/testing/internals/Bakefile +++ b/testing/internals/Bakefile @@ -1,6 +1,6 @@ target1() { - @ echo 1 + echo 1 } target2() { # Target description # Sub help @@ -15,3 +15,10 @@ flines() { commands() { _commands } + +echoing() { + @ echo some command + @ echo escaped \ + command \ + follows +}