Dieser Commit ist enthalten in:
Claude Project Manager
2025-07-07 22:11:38 +02:00
Commit ec92da8a64
73 geänderte Dateien mit 16367 neuen und 0 gelöschten Zeilen

41
test_git_detection.py Normale Datei
Datei anzeigen

@ -0,0 +1,41 @@
#!/usr/bin/env python3
"""Test script to check if git repository detection is working"""
import os
import json
from pathlib import Path
# Load projects
with open('data/projects.json', 'r') as f:
data = json.load(f)
projects = data.get('projects', [])
print("Testing Git repository detection:\n")
for project in projects:
if project['id'] not in ["vps-permanent", "admin-panel-permanent", "vps-docker-permanent"]:
project_path = Path(project['path'])
git_path = project_path / ".git"
print(f"Project: {project['name']}")
print(f" Path: {project_path}")
print(f" Git repo exists: {git_path.exists()}")
if git_path.exists():
# Check remote
import subprocess
try:
result = subprocess.run(
["git", "remote", "-v"],
cwd=project_path,
capture_output=True,
text=True,
check=False
)
if result.returncode == 0:
print(f" Remotes: {result.stdout.strip()}")
else:
print(f" Error checking remotes: {result.stderr}")
except Exception as e:
print(f" Error: {e}")
print()