-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmaven-color
executable file
·48 lines (44 loc) · 1.88 KB
/
maven-color
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Formatting constants
UNDERLINE_ON=`echo -e "\033[4m"`
UNDERLINE_OFF=`echo -e "\033[24m"`
RESET=`echo -e "\033[0m"`
BOLD_ON=`echo -e "\033[1m"`
BOLD_OFF=`echo -e "\033[0m"`
Black=`echo -e "\033[0;30m"`
BlackBG=`echo -e "\033[0;40m"`
DarkGrey=`echo -e "\033[1;30m"`
DarkGreyBG=`echo -e "\033[1;40m"`
LightGrey=`echo -e "\033[0;37m"`
LightGreyBG=`echo -e "\033[0;47m"`
White=`echo -e "\033[1;37m"`
WhiteBG=`echo -e "\033[1;47m"`
Red=`echo -e "\033[0;31m"`
RedBG=`echo -e "\033[0;41m"`
LightRed=`echo -e "\033[1;31m"`
LightRedBG=`echo -e "\033[1;41m"`
Green=`echo -e "\033[0;32m"`
GreenBG=`echo -e "\033[0;42m"`
LightGreen=`echo -e "\033[1;32m"`
LightGreenBG=`echo -e "\033[1;42m"`
Brown=`echo -e "\033[0;33m"`
BrownBG=`echo -e "\033[0;43m"`
Yellow=`echo -e "\033[1;33m"`
YellowBG=`echo -e "\033[1;43m"`
Blue=`echo -e "\033[0;34m"`
BlueBG=`echo -e "\033[0;44m"`
LightBlue=`echo -e "\033[1;34m"`
LightBlueBG=`echo -e "\033[1;44m"`
Purple=`echo -e "\033[0;35m"`
PurpleBG=`echo -e "\033[0;45m"`
Pink=`echo -e "\033[1;35m"`
PinkBG=`echo -e "\033[1;45m"`
Cyan=`echo -e "\033[0;36m"`
CyanBG=`echo -e "\033[0;46m"`
LightCyan=`echo -e "\033[1;36m"`
LightCyanBG=`echo -e "\033[1;46m"`
LC_CTYPE=C
mvn $@ | \
sed --posix -e "s/\(\[INFO\]\ \-.*\)/${LightCyan}${BOLD_ON}\1${RESET}/g;s/\(\[INFO\]\ \-\-\-\ .*\)/${BOLD_ON}${UNDERLINE_ON}\1${RESET}/g;s/\(\[INFO\]\ Installing\)/${BOLD_ON}${Red}\1${RESET}/g;s/\(\[INFO\]\ BUILD SUCCESS\)/${BOLD_ON}${Green}\1${RESET}/g;s/\(\[WARNING\].*\)/${BOLD_ON}${Yellow}\1${RESET}/g;s/\(\[ERROR\].*\)/${BOLD_ON}${Red}\1${RESET}/g;s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD_ON}Tests run:${Green} \1${RESET}, Failures: ${BOLD_ON}${Red}\2${RESET}, Errors: ${BOLD_ON}${Red}\3${RESET}, Skipped: ${BOLD_ON}${Yelow}\4${RESET}/g" | \
sed --posix -E '/(\[INFO\].Downloading:.*).*/d;/(Downloading:.*).*/d;/([0-9]+\/[0-9]+ +K?B +).*/d'
exit ${PIPESTATUS[0]}