Created
July 17, 2014 16:10
-
-
Save AndrewReitz/01a3e098b95ecb83fda0 to your computer and use it in GitHub Desktop.
Linux Upfind + Gradlew
This file contains 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
# Find something in a directory above the one you are in | |
function upfind() { | |
dir=`pwd` | |
while [ "$dir" != "/" ]; do | |
path=`find "$dir" -maxdepth 1 -name $1` | |
if [ ! -z $path ]; then | |
echo "$path" | |
return | |
fi | |
dir=`dirname "$dir"` | |
done | |
} | |
# Finds the gradle wrapper and executes it with the parameter passed in | |
function gw() { | |
$(upfind gradlew) $@ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment