Skip to content

Commit

Permalink
use better names
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Walker committed Oct 20, 2020
1 parent fb33d35 commit c3bd6c4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/darwin/Framework/chip_xcode_build_connector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c3bd6c4

Please sign in to comment.