Skip to content

Instantly share code, notes, and snippets.

@Ghedeon
Created January 28, 2015 16:25
Show Gist options
  • Save Ghedeon/acc85e647f83291668da to your computer and use it in GitHub Desktop.
Save Ghedeon/acc85e647f83291668da to your computer and use it in GitHub Desktop.
The script searches for the Gradle Wrapper in the current directory and its parent directories and executes it. https://issues.gradle.org/browse/GRADLE-1378?focusedCommentId=17529&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17529
#!/bin/sh
D=$(pwd)
G="gradlew"
while [ ! -x "$D/$G" -a "$D" != "/" ]; do
D=$(dirname $D)
done
if [ ! -x "$D/$G" ]; then
echo "No Gradle found in current or parent directories!"
exit 1
fi
echo "Run Gradle $D/$G ..."
"$D/$G" $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment