diff --git a/bin/gw b/bin/gw index 74b32f3..3168cf1 100755 --- a/bin/gw +++ b/bin/gw @@ -17,9 +17,13 @@ lookup() { # Search recursively upwards for file. until [[ "${curr_path}" == "/" ]]; do + local curr_base=$(basename "${curr_path}") if [[ -e "${curr_path}/${file}" ]]; then echo "${curr_path}/${file}" break + elif [[ "${file}" == "${GRADLE_BUILDFILE}" && -e "${curr_path}/${curr_base}.gradle" ]]; then + echo "${curr_path}/${curr_base}.gradle" + break else curr_path=$(dirname "${curr_path}") fi