threads / patch / 10563

patchDo no colorify test output if stdout is not a terminal

Subject: [PATCH] Do no colorify test output if stdout is not a terminal

## tl;dr

2 messages between Nov 1, 2007 and Nov 1, 2007. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Alex Riesen· Nov 1, 2007, 14:01 UTC · lore
like when the output is redirected into a file in a cron job.
---
 t/test-lib.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Show changes to t/test-lib.sh +1 −0
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 714de6e..603a8cd 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -60,6 +60,7 @@ esac
 # . ./test-lib.sh
 
 [ "x$TERM" != "xdumb" ] &&
+	[ -t 1 ] &&
 	tput bold >/dev/null 2>&1 &&
 	tput setaf 1 >/dev/null 2>&1 &&
 	tput sgr0 >/dev/null 2>&1 &&
-- 
1.5.3.4.549.g2789

← back to recent threads