chore: fix root_dir resolution/stale scripts during PR review

This commit is contained in:
Gustavo Madeira Santana
2026-02-13 15:09:37 -05:00
parent 6442512954
commit 42eaee8b7e
6 changed files with 53 additions and 6 deletions

View File

@@ -8,7 +8,14 @@ fi
mode="$1"
pr="$2"
base="$(cd "$(dirname "$0")" && pwd)/pr"
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
case "$mode" in
init)