Browse Source

executing gradlew, when gradlew-file exists (#6485)

Janosch Schwalm 6 years ago
parent
commit
84aa274604
1 changed files with 12 additions and 0 deletions
  1. 12 0
      plugins/gradle/gradle.plugin.zsh

+ 12 - 0
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