mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 04:33:53 +00:00
chore: fix root_dir resolution/stale scripts during PR review
This commit is contained in:
@@ -2,6 +2,13 @@
|
||||
set -euo pipefail
|
||||
|
||||
script_dir="$(cd "$(dirname "$0")" && pwd)"
|
||||
base="$script_dir/pr"
|
||||
if common_git_dir=$(git -C "$script_dir" rev-parse --path-format=absolute --git-common-dir 2>/dev/null); then
|
||||
canonical_base="$(dirname "$common_git_dir")/scripts/pr"
|
||||
if [ -x "$canonical_base" ]; then
|
||||
base="$canonical_base"
|
||||
fi
|
||||
fi
|
||||
|
||||
usage() {
|
||||
cat <<USAGE
|
||||
@@ -13,7 +20,7 @@ USAGE
|
||||
}
|
||||
|
||||
if [ "$#" -eq 1 ]; then
|
||||
exec "$script_dir/pr" merge-verify "$1"
|
||||
exec "$base" merge-verify "$1"
|
||||
fi
|
||||
|
||||
if [ "$#" -eq 2 ]; then
|
||||
@@ -21,10 +28,10 @@ if [ "$#" -eq 2 ]; then
|
||||
pr="$2"
|
||||
case "$mode" in
|
||||
verify)
|
||||
exec "$script_dir/pr" merge-verify "$pr"
|
||||
exec "$base" merge-verify "$pr"
|
||||
;;
|
||||
run)
|
||||
exec "$script_dir/pr" merge-run "$pr"
|
||||
exec "$base" merge-run "$pr"
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
|
||||
Reference in New Issue
Block a user