backup-2025-12-19-20: Automated backup - 10 files changed
📋 Files modified: 10 ⏰ Timestamp: 2025-12-19 20:27:31 UTC 🔒 Security: PASSED (no secrets detected) 💾 Automated by Git Agent
This commit is contained in:
39
tools/commands/git_cleanup.py
Normal file
39
tools/commands/git_cleanup.py
Normal file
@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Git Cleanup Slash Command
|
||||
Usage: /git-cleanup
|
||||
Cleans up old backup branches
|
||||
"""
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
def main():
|
||||
"""Execute git cleanup command"""
|
||||
project_root = "K:\\Projects\\uniswap_auto_clp"
|
||||
git_agent_path = os.path.join(project_root, "tools", "git_agent.py")
|
||||
|
||||
try:
|
||||
result = subprocess.run(
|
||||
["python", git_agent_path, "--cleanup"],
|
||||
cwd=project_root,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=False
|
||||
)
|
||||
|
||||
if result.returncode == 0:
|
||||
print("[SUCCESS] Cleanup completed")
|
||||
print("Old backup branches have been removed according to retention policy.")
|
||||
else:
|
||||
error_msg = result.stderr or result.stdout or "Unknown error"
|
||||
print("[ERROR] Cleanup failed")
|
||||
print(f"Error: {error_msg}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ **Cleanup failed**")
|
||||
print(f"\nException: {str(e)}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user