-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate-checker.py
More file actions
36 lines (29 loc) · 939 Bytes
/
template-checker.py
File metadata and controls
36 lines (29 loc) · 939 Bytes
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
import json
import os
def check_templates():
# Load JSON data from all.json
with open("all.json", "r", encoding="utf-8") as f:
data = json.load(f)
# Folder where template JSON files should exist
template_folder = "templates"
# Track missing files
missing_ids = []
# Check each id
for entry in data:
file_name = f"{entry['id']}.json"
file_path = os.path.join(template_folder, file_name)
if not os.path.isfile(file_path):
if(entry['integration'] != "EXTERNAL_INTEGRATION"):
missing_ids.append(entry['id'])
# Report
if missing_ids:
print("Missing template files for the following IDs:")
for mid in missing_ids:
print(f"- {mid}")
return False
else:
print("✅ All template files are present.")
return True
# Run the check
if __name__ == "__main__":
result = check_templates()