mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 10:01:40 +00:00
* Adds a python script to load jsons to prevent any syntax error on them * Corrects identation on hallucination.json
20 lines
442 B
Python
20 lines
442 B
Python
import sys
|
|
import json
|
|
|
|
if len(sys.argv) <= 1:
|
|
exit(1)
|
|
|
|
files = filter(len, sys.argv[1].split('\n'))
|
|
msg = []
|
|
for file in files:
|
|
with open(file, encoding="ISO-8859-1") as f:
|
|
try:
|
|
json.load(f)
|
|
except ValueError as exception:
|
|
msg.append("JSON synxtax error on file: {}".format(file))
|
|
msg.append(str(exception))
|
|
if msg:
|
|
print("\n".join(msg))
|
|
exit(1)
|
|
exit(0)
|