diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh index c7047552d..8df62c2e2 100644 --- a/plugins/gradle/gradle.plugin.zsh +++ b/plugins/gradle/gradle.plugin.zsh @@ -1,6 +1,18 @@ ############################################################################## # A descriptive listing of core Gradle commands ############################################################################ + +gradle-or-gradlew() { + if [ -f ./gradlew ] ; then + echo "executing gradlew instead of gradle"; + ./gradlew "$@"; + else + gradle "$@"; + fi +} + +alias gradle=gradle-or-gradlew; + function _gradle_core_commands() { local ret=1 state _arguments ':subcommand:->subcommand' && ret=0