summaryrefslogtreecommitdiff
path: root/functions/defaults.sh
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-03-11 21:27:18 +0000
committerRaphaƫl Hertzog <hertzog@debian.org>2020-03-16 13:32:16 +0000
commit09b279b7bc02c5aeec3fc5e75732b338f92a3921 (patch)
tree223fe0db9d088218287848e6547187300afd08dd /functions/defaults.sh
parent49e68da5ee11a1e9dd7a6dfe1bcfcb8a0d21fe42 (diff)
downloadvyos-live-build-09b279b7bc02c5aeec3fc5e75732b338f92a3921.tar.gz
vyos-live-build-09b279b7bc02c5aeec3fc5e75732b338f92a3921.zip
turn on colour by default
...when stdout+stderr connected to a tty (as opposed for example to being piped to a log file) very helpful to have colour such that the red/yellow of errors/warnings can draw the eye to problems. Gbp-Dch: Short
Diffstat (limited to 'functions/defaults.sh')
-rwxr-xr-xfunctions/defaults.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/functions/defaults.sh b/functions/defaults.sh
index 695195d9d..108a9d96e 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -296,8 +296,12 @@ Set_config_defaults ()
esac
# Setting live build options
+ if [ -t 1 ] && [ -t 2 ]; then
+ _COLOR="${_COLOR:-true}"
+ else
+ _COLOR="${_COLOR:-false}"
+ fi
_BREAKPOINTS="${_BREAKPOINTS:-false}"
- _COLOR="${_COLOR:-false}"
_DEBUG="${_DEBUG:-false}"
_FORCE="${_FORCE:-false}"
_QUIET="${_QUIET:-false}"