env: only use color diffs on terminals
authorPhilip Prindeville <philipp@redfish-solutions.com>
Tue, 10 Apr 2018 22:57:06 +0000 (16:57 -0600)
committerJohn Crispin <john@phrozen.org>
Sat, 5 May 2018 07:44:43 +0000 (09:44 +0200)
When sending script/env diff's output to a file or pipeline, you
don't want escape characters for ANSI color sequences fouling the
byte stream.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
scripts/env

index 63e26eb..84166ae 100755 (executable)
@@ -104,7 +104,7 @@ env_list() {
 env_diff() {
        env_init
        env_sync_data
-       git diff --cached --color
+       git diff --cached --color=auto
        env_link_config
 }