Explorar o código

fix: correct repo path and add claude to PATH (#5)

Fixed two critical issues in handle-issue.sh script:

1. Repository Path Fix:
   - Changed from: $HOME/$OWNER/$REPO (e.g., /home/claude/fszontagh/agent-manager)
   - Changed to: $HOME/$REPO (e.g., /home/claude/agent-manager)
   - Updated mkdir command to not create owner subdirectory

2. Claude Command Path Fix:
   - Added export PATH="$HOME/.local/bin:$PATH" at script start
   - Ensures claude command is found when executing via webhook
   - Fixes "claude: command not found" error

These changes ensure:
- Repositories are cloned to the correct location
- Claude Code CLI is accessible from the webhook context

Fixes #5

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude hai 9 meses
pai
achega
13d7b41b78
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      scripts/handle-issue.sh

+ 5 - 2
scripts/handle-issue.sh

@@ -3,6 +3,9 @@
 # Script to handle issue automation with Claude Code
 # This script is called when an issue is opened or commented on
 
+# Add claude binary to PATH
+export PATH="$HOME/.local/bin:$PATH"
+
 # Parse arguments
 OWNER="$1"
 REPO="$2"
@@ -27,12 +30,12 @@ if [ "$ASSIGNEE" != "claude" ]; then
 fi
 
 # Determine repo path
-REPO_PATH="$HOME/$OWNER/$REPO"
+REPO_PATH="$HOME/$REPO"
 
 # Check if repo exists, if not clone it
 if [ ! -d "$REPO_PATH" ]; then
     echo "Repository not found at $REPO_PATH, cloning..."
-    mkdir -p "$HOME/$OWNER"
+    mkdir -p "$HOME"
     GIT_URL="ssh://git@207.154.220.231:10022/$OWNER/$REPO.git"
     git clone "$GIT_URL" "$REPO_PATH"