Last active
August 4, 2017 08:15
-
-
Save zhoulifu/6fc3784d47badabaa71b0ae805215a13 to your computer and use it in GitHub Desktop.
A wrapper of gradle wrapper for saving time from typing './'
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
#!/usr/bin/env bash | |
echoGreen() { echo $'\e[0;32m'"$1"$'\e[0m'; } | |
echoYellow() { echo $'\e[0;33m'"$1"$'\e[0m'; } | |
abort() { | |
echoYellow "Command 'gradle' not found in your PATH." | |
echoYellow "And could not found 'gradlew' in current directory." | |
echoYellow "Abort." | |
exit 1 | |
} | |
EXEC=`pwd`/gradlew | |
[[ -f $EXEC ]] || EXEC=`which gradle` || abort | |
echoGreen "Using gradle: $EXEC" | |
echo | |
exec "$EXEC" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment