diff --git a/skills/worktrees/scripts/create-worktree.sh b/skills/worktrees/scripts/create-worktree.sh index 56341f3..5718dd0 100755 --- a/skills/worktrees/scripts/create-worktree.sh +++ b/skills/worktrees/scripts/create-worktree.sh @@ -27,8 +27,8 @@ case "$MODE" in WORKTREE_NAME="${REPO_NAME}-issue-${ISSUE_NUMBER}" WORKTREE_PATH="${WORKTREES_DIR}/${WORKTREE_NAME}" - # Get issue title for branch name - ISSUE_TITLE=$(tea issues "$ISSUE_NUMBER" 2>/dev/null | grep -i "title" | head -1 | cut -d: -f2- | xargs || echo "untitled") + # Get issue title for branch name (tea issues output has title on line 2: " # #1 Title here") + ISSUE_TITLE=$(tea issues "$ISSUE_NUMBER" 2>/dev/null | sed -n '2p' | sed 's/.*#[0-9]* //' | xargs || echo "untitled") # Create safe branch name BRANCH_NAME="issue-${ISSUE_NUMBER}-$(echo "$ISSUE_TITLE" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd '[:alnum:]-' | cut -c1-50)"