-
-
Save keyboardsurfer/4135697f032dc8047c26 to your computer and use it in GitHub Desktop.
function to use gradle wrapper if it exists, else gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simply add this to your .bashrc, .zshrc or .whateverrc and re-source it. | |
# Afterwards you can use `gw` to invoke your local gradle wrapper if it exists. | |
function gw { | |
if [ -x "gradlew" ]; then | |
./gradlew $@ | |
else | |
gradle $@ | |
fi | |
} |
I don't have a gradle home env variable, but yes it might be worth a shot to do so.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Might be worth adding a check for $GRADLE_HOME/bin/gradle before using the path to find gradle to give people the option of specifying a gradle installation they want to use as a fall-back.