fix to spec runner paths

This commit is contained in:
AndyMik90
2025-12-17 22:18:11 +01:00
parent 32760348ae
commit 9babdc23c1
4 changed files with 70 additions and 2 deletions
+12
View File
@@ -1,3 +1,15 @@
## 2.3.1 - Linux Compatibility Fix
### 🐛 Bug Fixes
- Resolved path handling issues on Linux systems for improved cross-platform compatibility
---
## What's Changed
- fix: Fix to linux path issue by @AndyMik90 in 3276034
## 2.2.0 - 2025-12-17
### ✨ New Features
+10
View File
@@ -9,6 +9,16 @@ CLAUDE_CODE_OAUTH_TOKEN=your-oauth-token-here
# Default: claude-opus-4-5-20251101
# AUTO_BUILD_MODEL=claude-opus-4-5-20251101
# =============================================================================
# GIT/WORKTREE SETTINGS (OPTIONAL)
# =============================================================================
# Configure how Auto Claude handles git worktrees for isolated builds.
# Default base branch for worktree creation (OPTIONAL)
# If not set, Auto Claude will auto-detect main/master, or fall back to current branch.
# Common values: main, master, develop
# DEFAULT_BRANCH=main
# =============================================================================
# DEBUG MODE (OPTIONAL)
# =============================================================================
+47 -1
View File
@@ -15,6 +15,7 @@ This allows:
"""
import asyncio
import os
import re
import shutil
import subprocess
@@ -53,10 +54,55 @@ class WorktreeManager:
def __init__(self, project_dir: Path, base_branch: str | None = None):
self.project_dir = project_dir
self.base_branch = base_branch or self._get_current_branch()
self.base_branch = base_branch or self._detect_base_branch()
self.worktrees_dir = project_dir / ".worktrees"
self._merge_lock = asyncio.Lock()
def _detect_base_branch(self) -> str:
"""
Detect the base branch for worktree creation.
Priority order:
1. DEFAULT_BRANCH environment variable
2. Auto-detect main/master (if they exist)
3. Fall back to current branch (with warning)
Returns:
The detected base branch name
"""
# 1. Check for DEFAULT_BRANCH env var
env_branch = os.getenv("DEFAULT_BRANCH")
if env_branch:
# Verify the branch exists
result = subprocess.run(
["git", "rev-parse", "--verify", env_branch],
cwd=self.project_dir,
capture_output=True,
text=True,
)
if result.returncode == 0:
return env_branch
else:
print(f"Warning: DEFAULT_BRANCH '{env_branch}' not found, auto-detecting...")
# 2. Auto-detect main/master
for branch in ["main", "master"]:
result = subprocess.run(
["git", "rev-parse", "--verify", branch],
cwd=self.project_dir,
capture_output=True,
text=True,
)
if result.returncode == 0:
return branch
# 3. Fall back to current branch with warning
current = self._get_current_branch()
print(f"Warning: Could not find 'main' or 'master' branch.")
print(f"Warning: Using current branch '{current}' as base for worktree.")
print(f"Tip: Set DEFAULT_BRANCH=your-branch in .env to avoid this.")
return current
def _get_current_branch(self) -> str:
"""Get the current git branch."""
result = subprocess.run(
+1 -1
View File
@@ -240,7 +240,7 @@ Examples:
print()
# Build the run.py command
run_script = Path(__file__).parent / "run.py"
run_script = Path(__file__).parent.parent / "run.py"
run_cmd = [
sys.executable,
str(run_script),