-
-
Save MichaelEvans/b31ae84ce474771af2ed05442ee44db9 to your computer and use it in GitHub Desktop.
Add dirname and --offline to https://plus.google.com/+JakeWharton/posts/hPkaEwza6HG
This file contains hidden or 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
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