diff options
author | 2021-11-09 14:46:22 +0000 | |
---|---|---|
committer | 2021-11-10 17:40:37 +0000 | |
commit | 5298bcd20622df02bf207181ec6d758e0d2bf671 (patch) | |
tree | 0f2894b21159104f2a2aaf093e1d265378b2b6ca /tools/buildbot-utils.sh | |
parent | cbf71ec69f0ce1bc20418e3ba68430d17f97fed0 (diff) |
buildbot-*.sh scripts: clean up colorful messages.
Add helper functions `msginfo`, `msgwarning`, `msgerror`, `msgnote` and
use them in the buildbot scripts.
Bug: none
Test: ran tests in chroot as described in art/test/README.chroot.md,
observed no changes in the colored output
Change-Id: Ibd577c80ddabef2c04d4f814c46a0d70829f8946
Diffstat (limited to 'tools/buildbot-utils.sh')
-rwxr-xr-x | tools/buildbot-utils.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/buildbot-utils.sh b/tools/buildbot-utils.sh index 899a9a3eb7..32ed234d90 100755 --- a/tools/buildbot-utils.sh +++ b/tools/buildbot-utils.sh @@ -35,3 +35,25 @@ if [ -t 1 ]; then nc='\033[0m' fi + +function msginfo() { + local heading="$1" + shift + local message="$*" + echo -e "${green}${heading}${nc} ${message}" +} + +function msgwarning() { + local message="$*" + echo -e "${boldmagenta}Warning: ${nc}${message}" +} + +function msgerror() { + local message="$*" + echo -e "${boldred}Error: ${nc}${message}" +} + +function msgnote() { + local message="$*" + echo -e "${boldcyan}Note: ${nc}${message}" +} |