Commit 5f7d75d5ff1a14dcce79150055c1c873fa3a88cd
1 parent
a405a4a6
Exists in
master
and in
27 other branches
script/quick-start: don't throw ANSI escapes at non-terminals
Showing
1 changed file
with
10 additions
and
2 deletions
Show diff stats
script/quick-start
... | ... | @@ -2,12 +2,20 @@ |
2 | 2 | |
3 | 3 | say() { |
4 | 4 | msg="$@" |
5 | - printf "\033[1;34;49m%s\033[m\n" "$msg" | |
5 | + if [ -t 1 ]; then | |
6 | + printf "\033[1;34;49m%s\033[m\n" "$msg" | |
7 | + else | |
8 | + echo "$msg" | |
9 | + fi | |
6 | 10 | } |
7 | 11 | |
8 | 12 | complain() { |
9 | 13 | msg="$@" |
10 | - printf "\033[1;31;49m%s\033[m\n" "$msg" | |
14 | + if [ -t 1 ]; then | |
15 | + printf "\033[1;31;49m%s\033[m\n" "$msg" | |
16 | + else | |
17 | + echo "$msg" | |
18 | + fi | |
11 | 19 | } |
12 | 20 | |
13 | 21 | run() { | ... | ... |