Skip to content

Instantly share code, notes, and snippets.

@MichaelEvans
Forked from MartinWallgren/gw.sh
Created July 11, 2021 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MichaelEvans/b31ae84ce474771af2ed05442ee44db9 to your computer and use it in GitHub Desktop.
Save MichaelEvans/b31ae84ce474771af2ed05442ee44db9 to your computer and use it in GitHub Desktop.
export GRADLE_DEFAULT_OPTS='--offline'
function upfind() {
dir=`pwd`
while [ "$dir" != "/" ]; do
p=`find "$dir" -maxdepth 1 -name $1`
if [ ! -z $p ]; then
echo "$p"
return
fi
dir=`dirname "$dir"`
done
}
function gw() {
GW="$(upfind gradlew)"
if [ -z "$GW" ]; then
echo "Gradle wrapper not found."
else
dir=`dirname "$GW"`
$GW $GRADLE_DEFAULT_OPTS --project-dir $dir $@
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment