📋 Files modified: 10 ⏰ Timestamp: 2025-12-19 20:27:31 UTC 🔒 Security: PASSED (no secrets detected) 💾 Automated by Git Agent
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Git Backup Slash Command
|
|
Usage: /git-backup
|
|
Creates an automated backup using the Git Agent system
|
|
"""
|
|
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
def main():
|
|
"""Execute git backup 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, "--backup"],
|
|
cwd=project_root,
|
|
capture_output=True,
|
|
text=True,
|
|
check=False
|
|
)
|
|
|
|
if result.returncode == 0:
|
|
print("[SUCCESS] Backup completed successfully")
|
|
print("Automated backup created and pushed to remote repository.")
|
|
else:
|
|
error_msg = result.stderr or result.stdout or "Unknown error"
|
|
print("[ERROR] Backup failed")
|
|
print(f"Error: {error_msg}")
|
|
|
|
except Exception as e:
|
|
print(f"❌ **Backup failed**")
|
|
print(f"\nException: {str(e)}")
|
|
|
|
if __name__ == "__main__":
|
|
main() |