diff options
author | Atem18 <messer.kevin@gmail.com> | 2013-12-01 23:45:55 +0100 |
---|---|---|
committer | Atem18 <messer.kevin@gmail.com> | 2013-12-01 23:45:55 +0100 |
commit | 06bd72f842480d9556a1cc28cc340f1be7e7c79b (patch) | |
tree | baeb90abad8afab94f0535fe8f949b1d8df591be /plugins/mvn/mvn.plugin.zsh | |
parent | 84e178fa3d5e6e5bc36cb353c5c051d4f12ec35d (diff) | |
parent | 5643fac8870c2df284f1ccceab35fb1fe343fa3f (diff) | |
download | zsh-06bd72f842480d9556a1cc28cc340f1be7e7c79b.tar.gz zsh-06bd72f842480d9556a1cc28cc340f1be7e7c79b.tar.bz2 zsh-06bd72f842480d9556a1cc28cc340f1be7e7c79b.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'plugins/mvn/mvn.plugin.zsh')
-rw-r--r-- | plugins/mvn/mvn.plugin.zsh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 799f6fc8c..0c9141907 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -24,16 +24,18 @@ export RESET_FORMATTING=`tput sgr0` # Wrapper function for Maven's mvn command. mvn-color() { - # Filter mvn output using sed - mvn $@ | sed -e "s/\(\[INFO\]\ \-.*\)/${TEXT_BLUE}${BOLD}\1/g" \ - -e "s/\(\[INFO\]\ \[.*\)/${RESET_FORMATTING}${BOLD}\1${RESET_FORMATTING}/g" \ + ( + # Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations + unset LANG + LC_CTYPE=C mvn $@ | sed -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \ -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \ - -e "s/\(\[WARNING\].*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}/g" \ - -e "s/\(\[ERROR\].*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}/g" \ + -e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \ + -e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \ -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g" # Make sure formatting is reset echo -ne ${RESET_FORMATTING} + ) } # Override the mvn command with the colorized one. |