From bd9a60479053a8be5e61e9b8e2a7f2e317530989 Mon Sep 17 00:00:00 2001 From: Janosch Schwalm Date: Mon, 11 Dec 2017 20:08:18 +0100 Subject: [PATCH] executing mvnw, when mvnw-file exists indriectly enable autocompletion for mvnw --- plugins/mvn/mvn.plugin.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index ee6fe2770..c1e445c0b 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -20,6 +20,14 @@ 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 + ./mvnw "$@"; + else + mvn "$@"; + fi +} # Wrapper function for Maven's mvn command. mvn-color() { @@ -40,6 +48,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' @@ -274,3 +285,5 @@ function listMavenCompletions { } compctl -K listMavenCompletions mvn +compctl -K listMavenCompletions mvn-or-mvnw +