mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
CI/linux-qt6/validate_json.py: Use sys.exit(1) instead of throwing Exception
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
@ -54,6 +55,6 @@ for path in sorted(Path(".").glob("**/*.json")):
|
|||||||
errors.append({"error_pos": error_pos, "error_msg": exc})
|
errors.append({"error_pos": error_pos, "error_msg": exc})
|
||||||
|
|
||||||
if errors:
|
if errors:
|
||||||
print("Summary of errors:")
|
print("The following JSON files are invalid:")
|
||||||
pprint(errors)
|
pprint(errors)
|
||||||
raise Exception("Not all JSON files are valid")
|
sys.exit(1)
|
||||||
|
Reference in New Issue
Block a user