✨ EXTENDED: Deabonination, Berechtigungen, Sortierung der Projekte
docker-build-and-push / build (push) Successful in 18s
docker-build-and-push / build (push) Successful in 18s
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import subprocess
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
@@ -17,9 +18,40 @@ def clone_repo(repo_url: str, target_dir: Path, token: str = None):
|
||||
text=True
|
||||
)
|
||||
|
||||
# ✅ BERECHTIGUNGEN SETZEN NACH DEM KLOONEN!
|
||||
if result.returncode == 0:
|
||||
try:
|
||||
os.chmod(str(target_dir), 0o755)
|
||||
for root, dirs, files in os.walk(str(target_dir)):
|
||||
for d in dirs:
|
||||
os.chmod(os.path.join(root, d), 0o755)
|
||||
for f in files:
|
||||
os.chmod(os.path.join(root, f), 0o644)
|
||||
except Exception as e:
|
||||
print(f"Warnung bei Berechtigungen: {e}")
|
||||
|
||||
return {"success": result.returncode == 0, "output": result.stdout, "error": result.stderr}
|
||||
|
||||
|
||||
def unsubscribe_repo(target_dir: Path):
|
||||
"""Loescht ein abonniertes Projekt."""
|
||||
import shutil
|
||||
|
||||
if not target_dir.exists():
|
||||
return {"success": False, "error": "Projekt nicht gefunden"}
|
||||
|
||||
try:
|
||||
# ✅ ALLE CHANGES MARKIERUNG LÖSCHEN
|
||||
changes_marker = target_dir / ".gitea-changes.marker"
|
||||
if changes_marker.exists():
|
||||
changes_marker.unlink()
|
||||
|
||||
shutil.rmtree(str(target_dir))
|
||||
return {"success": True, "message": f"{target_dir.name} erfolgreich geloescht"}
|
||||
except Exception as e:
|
||||
return {"success": False, "error": str(e)}
|
||||
|
||||
|
||||
def push_changes(repo_path: Path, message: str = "Update 🧠"):
|
||||
"""Pusht lokale Änderungen ins Repository."""
|
||||
result = subprocess.run(
|
||||
|
||||
Reference in New Issue
Block a user