diff --git a/.bashrc b/.bashrc index 31e867d..ed939d9 100644 --- a/.bashrc +++ b/.bashrc @@ -24,13 +24,14 @@ __lazy_ssh_agent() { alias ssh='__lazy_ssh_agent; ssh' alias sudo='__lazy_ssh_agent; sudo' -# alias to colourise make output -_make() { +# colourises make output, so when it prints via +# $(warning) or $(error), it is formatted properly +__colour_make() { make "$@" 2> >(sed -E \ -e "s/^([Mm]akefile:[0-9]+:.*)/\x1b[33m\1\x1b[0m/" \ -e "s/^.*error.*$/\x1b[31m&\x1b[0m/I" >&2) } -alias make='_make' +alias make='__colour_make' # lazily loads the git utilities, to prevent slowdowns __lazy_git_ps1() {