From 280668ce1349055813ff31d3e3bb5c0971832198 Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Thu, 6 Oct 2022 11:26:56 +0200 Subject: [PATCH] chore: portable stdout coloring in scripts BSD's (macos) version of echo does not support -e flag --- scripts/rel/cut4x.sh | 4 ++-- scripts/rel/sync-remotes.sh | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/rel/cut4x.sh b/scripts/rel/cut4x.sh index 58131c757..1b1af4a69 100755 --- a/scripts/rel/cut4x.sh +++ b/scripts/rel/cut4x.sh @@ -40,10 +40,10 @@ EOF } logerr() { - echo -e "\e[31mERROR: $1\e[39m" + echo "$(tput setaf 1)ERROR: $1$(tput sgr0)" } logmsg() { - echo -e "\e[33mINFO: $1\e[39m" + echo "INFO: $1" } REL_BRANCH_CE="${REL_BRANCH_CE:-release-v43}" diff --git a/scripts/rel/sync-remotes.sh b/scripts/rel/sync-remotes.sh index c79e7b957..550c65cf6 100755 --- a/scripts/rel/sync-remotes.sh +++ b/scripts/rel/sync-remotes.sh @@ -45,11 +45,10 @@ EOF } logerr() { - echo -e "\e[31mERROR: $1\e[39m" + echo "$(tput setaf 1)ERROR: $1$(tput sgr0)" } - logwarn() { - echo -e "\e[33mINFO: $1\e[39m" + echo "$(tput setaf 3)WARNING: $1$(tput sgr0)" } logmsg() {