add pipeline check to ensure problems like longsword file don't repeat
@@ -37,6 +37,19 @@ validate_json:
37
37
print(f"ERROR: templates directory not found: {templates_dir.resolve()}")
38
38
sys.exit(1)
39
39
40
# NEW: ensure all files under /data are .json (no other extensions, no extensionless files)
41
bad_files = []
42
for p in sorted(data_dir.rglob("*")):
43
if p.is_file() and p.suffix.lower() != ".json":
44
bad_files.append(p.as_posix())
45
46
if bad_files:
47
print("\nDATA DIRECTORY VALIDATION FAILED\n")
48
print("ERROR: Non-JSON files found under web/data (only .json allowed):")
49
for bf in bad_files:
50
print(" - " + bf)
51
sys.exit(1)
52
40
53
json_files = sorted(data_dir.rglob("*.json"))
41
54
if not json_files:
42
55
print(f"ERROR: No .json files found under {data_dir}")
@@ -37,6 +37,19 @@ validate_json:37
print(f"ERROR: templates directory not found: {templates_dir.resolve()}")37
print(f"ERROR: templates directory not found: {templates_dir.resolve()}")38
sys.exit(1)38
sys.exit(1)39
39
40
# NEW: ensure all files under /data are .json (no other extensions, no extensionless files)41
bad_files = []42
for p in sorted(data_dir.rglob("*")):43
if p.is_file() and p.suffix.lower() != ".json":44
bad_files.append(p.as_posix())45
46
if bad_files:47
print("\nDATA DIRECTORY VALIDATION FAILED\n")48
print("ERROR: Non-JSON files found under web/data (only .json allowed):")49
for bf in bad_files:50
print(" - " + bf)51
sys.exit(1)52
40
json_files = sorted(data_dir.rglob("*.json"))53
json_files = sorted(data_dir.rglob("*.json"))41
if not json_files:54
if not json_files:42
print(f"ERROR: No .json files found under {data_dir}")55
print(f"ERROR: No .json files found under {data_dir}")