From: Otto Moerbeek Date: Wed, 27 Nov 2019 13:42:39 +0000 (+0100) Subject: Do not show verbose messages if !tty X-Git-Tag: auth-4.3.0-alpha1~19^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d028ff3a1131783a78b9945c97df50895b350c6;p=thirdparty%2Fpdns.git Do not show verbose messages if !tty --- diff --git a/build-scripts/format-code b/build-scripts/format-code index 13698a1d9f..ed4898f33b 100755 --- a/build-scripts/format-code +++ b/build-scripts/format-code @@ -20,9 +20,19 @@ if [ ! -e .clang-format ]; then exit 1 fi +verbose=0 +if tty > /dev/null; then + verbose=1 +fi +if [ x$CIRCLECI = xtrue ]; then + verbose=0 +fi + for file in "${@}"; do if [ -h "$file" -o ! -f "$file" ]; then - echo "$file: skipped, not a regular file or unreadable" + if [ $verbose = 1 ]; then + echo "$file: skipped, not a regular file or unreadable" + fi continue fi tmp=$(mktemp "$file.XXXXXXXX") @@ -33,7 +43,9 @@ for file in "${@}"; do echo "$file: reformatted" mv "$tmp" "$file" else - echo "$file: already formatted to perfection" + if [ $verbose = 1 ]; then + echo "$file: already formatted to perfection" + fi rm "$tmp" fi fi