From 896e963b987624255afeefbe318f8144c044368a Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Thu, 21 Apr 2016 15:52:21 +1000 Subject: [PATCH] Hide the zuul-cloner output unless there is an error The setup of the git repos can be a little chatty. Hide the output in the common case. Change-Id: I110df3e0f3c9033c3fe76b2f534a67d2cb31fbc9 --- functions | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/functions b/functions index 1bd2ca8..890460e 100644 --- a/functions +++ b/functions @@ -83,6 +83,12 @@ function clone_repo { branch="master" fi title "Cloning $repo" - zuul-cloner --branch "$branch" git://git.openstack.org $repo \ - && (cd $repo && git review -s) + output=$({ zuul-cloner --branch "$branch" git://git.openstack.org $repo \ + && (cd $repo && git review -s); } 2>&1) + _retval=$? + if [ $_retval -ne 0 ] ; then + echo "$output" + fi + + return $_retval }