dotfiles
dotfiles copied to clipboard
Color-always on grep breaks CircleCI (and possibly other bash scripts)
https://github.com/supertopher/dotfiles/blob/93a2e91931f96b5bbd7b4e3c6a76c6273eea55f9/.bash_profile#L75
If you have a bash script (like CircleCI's CLI: https://circle-downloads.s3.amazonaws.com/releases/build_agent_wrapper/circleci) that redirects the grep output into a file, you get escape characters for the coloring in the file, which in this case, broke the script in a very non-obvious way.
I ran into this today. Here's a fix that lets you still have colors:
export GREP_OPTIONS='--color=auto'
This won't output the color character if in a non-interactive environment.