From 1fdbea527602ffe584fe824cb460afbc44f72396 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 5 Oct 2015 16:41:05 +0200 Subject: util: Provide functions to disable output --- nix-utils.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/nix-utils.sh b/nix-utils.sh index a34a2ee..de1f76f 100644 --- a/nix-utils.sh +++ b/nix-utils.sh @@ -5,6 +5,21 @@ Red='\e[0;31m' Yellow='\e[0;33m' Green='\e[0;32m' +# +# Do something explicitely without verbosity output +# +__quiet__() { + VERBOSE=0 $* +} + +# +# Do something explicitely without debug and verbosity output (with no output at +# all therefor) +# +__silent__() { + DEBUG=0 __quiet__ $* +} + # # Check whether a string (2nd arg) contains a substring (1st arg) # -- cgit v1.2.3 From 32ee12997d95854d17aadc39722b329854cff613 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 5 Oct 2015 16:41:17 +0200 Subject: Call git here without explanation output Fixes #105 --- nix-script-switch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix-script-switch.sh b/nix-script-switch.sh index 93d8d49..6d14122 100755 --- a/nix-script-switch.sh +++ b/nix-script-switch.sh @@ -170,7 +170,7 @@ dbg "ARGS = $ARGS" [[ ! -d "$WD" ]] && stderr "No directory: $WD" && exit 1 -TAG_TARGET=$(__git "$WD" rev-parse HEAD) +TAG_TARGET=$(__quiet__ __git "$WD" rev-parse HEAD) stdout "Tag in config will be generated at '$TAG_TARGET'" if [[ -z "$DONT_BUILD" ]] -- cgit v1.2.3