-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcheck_files.py
More file actions
executable file
·54 lines (41 loc) · 1.27 KB
/
check_files.py
File metadata and controls
executable file
·54 lines (41 loc) · 1.27 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
47
48
49
50
51
52
53
54
#!/usr/bin/env python3
"""Check that all required files exist in generated projects."""
import sys
from pathlib import Path
REQUIRED_FILES = [
"pyproject.toml",
"README.md",
"AGENTS.md",
".opencode/agents/developer.md",
".opencode/agents/architect.md",
".opencode/agents/repo-manager.md",
"Dockerfile",
]
def check_project(project_dir: str) -> tuple[bool, list[str]]:
"""Check a project for required files."""
project_path = Path(project_dir)
missing = []
for file_path in REQUIRED_FILES:
full_path = project_path / file_path
if not full_path.exists():
missing.append(file_path)
return len(missing) == 0, missing
def main():
projects = ["python-project-example", "custom-test-project"]
all_present = True
for project in projects:
present, missing = check_project(project)
if present:
print(f"PASS: All required files present in {project}")
else:
print(f"FAIL: Missing files in {project}:")
for f in missing:
print(f" - {f}")
all_present = False
if all_present:
print("\nAll required files are present")
return 0
else:
sys.exit(1)
if __name__ == "__main__":
sys.exit(main())