Initial commit
Dieser Commit ist enthalten in:
41
test_git_detection.py
Normale Datei
41
test_git_detection.py
Normale Datei
@ -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()
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren