Created
August 15, 2016 11:17
-
-
Save MartinWallgren/2d4a86becc15d3f396399a0a0b43c397 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