From 6ec57c0bde522ec225859201bf8d097f6eed04c7 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 4 Feb 2016 18:15:40 +0100 Subject: [PATCH] Add silent() helper for calling without debugging output --- imag-store/tests/utils.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/imag-store/tests/utils.sh b/imag-store/tests/utils.sh index 7f12cb55..148eaf87 100644 --- a/imag-store/tests/utils.sh +++ b/imag-store/tests/utils.sh @@ -9,15 +9,19 @@ RUNTIME="/tmp" STORE="${RUNTIME}/store" out() { - echo -e "${YELLOW}:: $*${COLOR_OFF}" + [[ -z "$DEBUG_OUTPUT_OFF" ]] && echo -e "${YELLOW}:: $*${COLOR_OFF}" } success() { - echo -e "${GREEN}>> $*${COLOR_OFF}" + [[ -z "$DEBUG_OUTPUT_OFF" ]] && echo -e "${GREEN}>> $*${COLOR_OFF}" } err() { - echo -e "${RED}!! $*${COLOR_OFF}" + [[ -z "$DEBUG_OUTPUT_OFF" ]] && echo -e "${RED}!! $*${COLOR_OFF}" +} + +silent() { + DEBUG_OUTPUT_OFF=1 $* } imag-store() {