mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
execute mvnw with "mvn" when mvnw-file is present (#6484)
* executing mvnw, when mvnw-file exists indriectly enable autocompletion for mvnw * inform the user :)
This commit is contained in:
parent
84aa274604
commit
3cd8eaf9bb
1 changed files with 14 additions and 0 deletions
|
@ -20,6 +20,15 @@ BACKGROUND_CYAN=$(tput setab 6)
|
|||
BACKGROUND_WHITE=$(tput setab 7)
|
||||
RESET_FORMATTING=$(tput sgr0)
|
||||
|
||||
# if found a ./mvnw file execute it otherwise execute orignal mvn
|
||||
mvn-or-mvnw() {
|
||||
if [ -f ./mvnw ] ; then
|
||||
echo "executing mvnw instead of mvn"
|
||||
./mvnw "$@";
|
||||
else
|
||||
mvn "$@";
|
||||
fi
|
||||
}
|
||||
|
||||
# Wrapper function for Maven's mvn command.
|
||||
mvn-color() {
|
||||
|
@ -40,6 +49,9 @@ mvn-color() {
|
|||
# Override the mvn command with the colorized one.
|
||||
#alias mvn="mvn-color"
|
||||
|
||||
# either use orignal mvn oder the mvn wrapper
|
||||
alias mvn="mvn-or-mvnw"
|
||||
|
||||
# aliases
|
||||
alias mvncie='mvn clean install eclipse:eclipse'
|
||||
alias mvnci='mvn clean install'
|
||||
|
@ -276,3 +288,5 @@ function listMavenCompletions {
|
|||
}
|
||||
|
||||
compctl -K listMavenCompletions mvn
|
||||
compctl -K listMavenCompletions mvn-or-mvnw
|
||||
|
||||
|
|
Loading…
Reference in a new issue