Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
8723a2ce
Commit
8723a2ce
authored
Nov 06, 2012
by
Carlos Alexandro Becker
Browse files
mvn.colors.plugin.zsh was not read... mergin with mvn.plugin.zsh.
parent
15e0dc9e
Changes
2
Show whitespace changes
Inline
Side-by-side
plugins/mvn/mvn.color.plugin.zsh
deleted
100644 → 0
View file @
15e0dc9e
# mvn-color based on https://gist.github.com/1027800
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
`
# 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"
\
-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/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.
alias
mvn
=
"mvn-color"
plugins/mvn/mvn.plugin.zsh
View file @
8723a2ce
# mvn-color based on https://gist.github.com/1027800
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
`
# 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"
\
-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/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.
alias
mvn
=
"mvn-color"
# aliases
alias
mvncie
=
'mvn clean install eclipse:eclipse'
alias
mvnci
=
'mvn clean install'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment