From c3bd6c4eac7753bf7b5704a665ae6d7c8c43f98f Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Tue, 20 Oct 2020 14:22:23 -0700 Subject: [PATCH] use better names --- src/darwin/Framework/chip_xcode_build_connector.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/darwin/Framework/chip_xcode_build_connector.sh b/src/darwin/Framework/chip_xcode_build_connector.sh index 2cadbf04fdcaa7..aeb48a61062279 100755 --- a/src/darwin/Framework/chip_xcode_build_connector.sh +++ b/src/darwin/Framework/chip_xcode_build_connector.sh @@ -100,25 +100,25 @@ fi ) } -updirs() { - declare lookinfer="${1}" +find_in_ancestors() { + declare to_find="${1}" declare dir="${2:-$(pwd)}" - while [[ ! -e ${dir}/${lookinfer} && -n ${dir} ]]; do + while [[ ! -e ${dir}/${to_find} && -n ${dir} ]]; do dir=${dir%/*} done - if [[ ! -e ${dir}/${lookinfer} ]]; then - printf 'error: updirs: %s not found\n' "$lookinfer" >&2 + if [[ ! -e ${dir}/${to_find} ]]; then + printf 'error: find_in_ancestors: %s not found\n' "$to_find" >&2 return 1 fi - printf '%s\n' "$dir/$lookinfer" + printf '%s\n' "$dir/$to_find" } ( cd "$CHIP_ROOT" # pushd and popd because we need the env vars from activate - if ENV=$(updirs chip_xcode_build_connector_env.sh 2>/dev/null); then + if ENV=$(find_in_ancestors chip_xcode_build_connector_env.sh 2>/dev/null); then . "$ENV" fi