Bash script to colourise Maven output in command line
I’ve been using Maven for Android projects quite extensively from command line lately and I found that a colour output is really helpful.
Disclaimer: I’m using iTerm2 on MacOs Mavericks (10.9). I’ve found a couple of bash scripts to colorise Maven output like https://gist.github.com/mike-ensor/1881211 and https://gist.github.com/dant3/7444827
I’ve customised my script using both examples above…so enjoy a new, even more colourful version below. If you have issues with
sed and unrecognised characters (“
sed: RE error: illegal byte sequence“), you can add the following lines in your
unset LANG export LC_CTYPE=C
Just drop this code below in a file and add it in your
~/.zshrc. Here’s my example.
The code is available as a Gist.
Curious to see how it looks? See the screenshots of my console