Skip to content

Instantly share code, notes, and snippets.

@semistrict
Last active December 26, 2015 23:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save semistrict/7229387 to your computer and use it in GitHub Desktop.
Save semistrict/7229387 to your computer and use it in GitHub Desktop.
gradlew search script
#!/bin/bash
_dir=$(pwd -P)
_lastdir=
until [ "$_dir" -ef "$_lastdir" ]; do
_cmd="$_dir/gradlew"
if test -e "$_cmd"; then
exec "$_cmd" "$@"
return $?
fi
_lastdir=$_dir
_dir="$(cd "$_dir/.." && pwd -P)"
done
echo "No `gradlew` script found. Run `gradle init` in the root directory of your project to initialize a new Gradle project."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment