-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcleanup_old_actions.py
More file actions
46 lines (37 loc) · 1.46 KB
/
cleanup_old_actions.py
File metadata and controls
46 lines (37 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python3
"""Clean up old individual action files after consolidation"""
from pathlib import Path
import shutil
def cleanup_old_files():
"""Remove old individual action files"""
actions_dir = Path(__file__).parent / "app" / "actions"
# Remove agents and rules directories
agents_dir = actions_dir / "agents"
rules_dir = actions_dir / "rules"
removed_count = 0
if agents_dir.exists():
file_count = len(list(agents_dir.glob("*")))
print(f"Removing agents directory with {file_count} files...")
shutil.rmtree(agents_dir)
removed_count += file_count
if rules_dir.exists():
file_count = len(list(rules_dir.glob("*")))
print(f"Removing rules directory with {file_count} files...")
shutil.rmtree(rules_dir)
removed_count += file_count
# Remove old mcps.json
mcps_json = actions_dir / "mcps.json"
if mcps_json.exists():
print("Removing mcps.json...")
mcps_json.unlink()
removed_count += 1
print(f"\nCleanup complete! Removed {removed_count} files/directories.")
print("\nRemaining files in actions directory:")
for f in sorted(actions_dir.glob("*.yaml")):
print(f" - {f.name}")
if __name__ == "__main__":
response = input("This will remove all old individual action files. Continue? (y/n): ")
if response.lower() == 'y':
cleanup_old_files()
else:
print("Cleanup cancelled.")