File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -13,25 +13,29 @@ if [[ "${1:-}" == "--dry-run" ]]; then
1313 shift
1414fi
1515
16- # Get PR number and custom message (optional)
1716PR_NUMBER=" ${1:- } "
1817CUSTOM_MESSAGE=" ${2:- } "
18+ EXPLICIT_SESSION=" ${3:- } "
19+
20+ if [[ -n " $EXPLICIT_SESSION " ]]; then
21+ echo " Using explicit session: $EXPLICIT_SESSION " >&2
22+ if [[ -z " $CUSTOM_MESSAGE " ]]; then
23+ echo " ERROR: Explicit session requires custom message" >&2
24+ exit 1
25+ fi
26+ bash " ${SCRIPT_DIR} /anvil" --session " $EXPLICIT_SESSION " " $CUSTOM_MESSAGE "
27+ exit 0
28+ fi
1929
20- # Get current repo directory and remote URL
2130REPO_DIR=$( git rev-parse --show-toplevel 2> /dev/null || pwd)
2231
23- # Get git remote URL to filter sessions working on this specific repo
2432GIT_REMOTE=$( git remote get-url origin 2> /dev/null || echo " " )
2533if [[ -n " $GIT_REMOTE " ]]; then
26- # Extract repo path from URL (works for both SSH and HTTPS)
27- # git@github.com:owner/repo.git -> github.com/owner/repo
28- # https://github.com/owner/repo.git -> github.com/owner/repo
2934 REPO_PATH=$( echo " $GIT_REMOTE " | sed -E ' s#^(https://|git@)##' | sed ' s#:#/#' | sed ' s#\.git$##' )
3035else
3136 REPO_PATH=" "
3237fi
3338
34- # Find all sessions in this repo using anvil
3539SESSIONS=$( bash " ${SCRIPT_DIR} /anvil" --list --repo " $REPO_DIR " --json 2> /dev/null)
3640if [[ -z " $SESSIONS " ]] || [[ " $SESSIONS " == " []" ]]; then
3741 echo " No sessions found in $REPO_DIR " >&2
You can’t perform that action at this time.
0 commit comments