Skip to content

Commit

Permalink
Only print in color if output is tty
Browse files Browse the repository at this point in the history
  • Loading branch information
jez committed Jan 10, 2018
1 parent 36859e8 commit 6fc30fd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions git-heatmap
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ files() {
}

color_name() {
# \(.*\/\)\([^/ ]*\)
sed -e "s/\(..*\/\)*\(.[^|]*\) |/\1$ccyan\2$cnone |/"
if [ -t 1 ]; then
sed -e "s/\(..*\/\)*\(.[^|]*\) |/\1$ccyan\2$cnone |/"
else
cat -
fi
}

filter() {
Expand Down

0 comments on commit 6fc30fd

Please sign in to comment.