From 82d9d8a0c53969db8ef542cc894ff2c5d4b779f3 Mon Sep 17 00:00:00 2001 From: Cameron Fieber Date: Fri, 12 Apr 2019 10:14:26 -0700 Subject: [PATCH] support gradle buildfile named after the directory --- bin/gw | 4 ++++ 1 file changed, 4 insertions(+) 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