-
Notifications
You must be signed in to change notification settings - Fork 2
/
aliases
executable file
·67 lines (58 loc) · 2.53 KB
/
aliases
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# My custom alias
alias update='sudo apt-get update && sudo apt-get upgrade -y'
alias svnreloc='svn switch --relocate'
alias desligar='sudo shutdown -h now'
alias reiniciar='sudo shutdown -r now'
alias setclip='xclip -selection c'
alias getclip='xclip -selection clipboard -o'
#colors
alias txtred=$(tput setaf 1) # Red
alias txtgrn=$(tput setaf 2) # Green
alias txtylw=$(tput setaf 3) # Yellow
alias txtblu=$(tput setaf 4) # Blue
alias txtpur=$(tput setaf 5) # Purple
alias txtcyn=$(tput setaf 6) # Cyan
alias txtwht=$(tput setaf 7) # White
alias txtrst=$(tput sgr0) # Text reset
alias txtund=$(tput sgr 0 1) # Underline
alias txtbld=$(tput bold) # Bold
# User specific aliases and functions for all shells
mvn-color()
{
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`
export TEXT_BLUE=`tput setaf 4`
export TEXT_MAGENTA=`tput setaf 5`
export TEXT_CYAN=`tput setaf 6`
export TEXT_WHITE=`tput setaf 7`
export BACKGROUND_BLACK=`tput setab 0`
export BACKGROUND_RED=`tput setab 1`
export BACKGROUND_GREEN=`tput setab 2`
export BACKGROUND_YELLOW=`tput setab 3`
export BACKGROUND_BLUE=`tput setab 4`
export BACKGROUND_MAGENTA=`tput setab 5`
export BACKGROUND_CYAN=`tput setab 6`
export BACKGROUND_WHITE=`tput setab 7`
export RESET_FORMATTING=`tput sgr0`
# Filter mvn output using sed
mvn $@ | sed -e "s/\(\[INFO\]\ \-.*\)/${BOLD}\1${RESET_FORMATTING}/g" \
-e "s/\(\[INFO\]\ \[.*\)/${RESET_FORMATTING}${BOLD}\1${RESET_FORMATTING}/g" \
-e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \
-e "s/\(\[debug\].*\)/${TEXT_CYAN}\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/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"
MVN_EXIT=${PIPESTATUS[0]}
# Make sure formatting is reset
echo -ne ${RESET_FORMATTING}
return $MVN_EXIT
}
alias mvn-color="mvn-color"
alias mvc=mvn-color
alias mvn=mvn-color