Skip to content

Commit

Permalink
Add a plugin that makes it easier to use the gradle wrapper if a proj…
Browse files Browse the repository at this point in the history
…ect has one.
  • Loading branch information
mcquinne committed Dec 16, 2016
1 parent 1e9c8bf commit da0b610
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions plugins/available/gradle.plugin.bash
@@ -0,0 +1,22 @@
cite about-plugin
about-plugin 'Add a gw command to use gradle wrapper if present, else use system gradle'

function gw() {
local file="gradlew"
local curr_path="${PWD}"
local result="gradle"

# Search recursively upwards for file.
until [[ "${curr_path}" == "/" ]]; do
if [[ -e "${curr_path}/${file}" ]]; then
result="${curr_path}/${file}"
break
else
curr_path=$(dirname "${curr_path}")
fi
done

# Call gradle
"${result}" $*
}

0 comments on commit da0b610

Please sign in to comment.