File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,25 @@ if [[ ! -d "${REPO_ROOT}" ]]; then
2020 fi
2121fi
2222SPEC_DIR=" ${REPO_ROOT} /spec"
23+ VENDORED_BEAR=" ${REPO_ROOT} /tools/bear-cli/bin/bear"
24+ LOCAL_BEAR=" ${REPO_ROOT} /.bear/tools/bear-cli/bin/bear"
25+
26+ run_bear () {
27+ if [[ -f " ${VENDORED_BEAR} " ]]; then
28+ bash " ${VENDORED_BEAR} " " $@ "
29+ return $?
30+ fi
31+ if [[ -f " ${LOCAL_BEAR} " ]]; then
32+ bash " ${LOCAL_BEAR} " " $@ "
33+ return $?
34+ fi
35+ if command -v bear > /dev/null 2>&1 ; then
36+ bear " $@ "
37+ return $?
38+ fi
39+ echo " pr-gate: missing BEAR CLI. Expected tools/bear-cli/bin/bear, .bear/tools/bear-cli/bin/bear, or bear on PATH." >&2
40+ return 127
41+ }
2342
2443mapfile -t IR_FILES < <( find " ${SPEC_DIR} " -maxdepth 1 -type f -name ' *.bear.yaml' 2> /dev/null | sort)
2544
3251for ir in " ${IR_FILES[@]} " ; do
3352 rel=" spec/$( basename " ${ir} " ) "
3453 echo " pr-gate: checking ${rel} against ${BASE_REF} "
35- bash " ${SCRIPT_DIR} /bear.sh " pr-check " ${rel} " --project " ${REPO_ROOT} " --base " ${BASE_REF} "
54+ run_bear pr-check " ${rel} " --project " ${REPO_ROOT} " --base " ${BASE_REF} "
3655done
37-
You can’t perform that action at this time.
0 commit comments