Fix, only parse valid JSON files

This commit is contained in:
Alicia Sykes
2023-04-16 21:28:32 +01:00
parent 8c221377d2
commit 7a484975e2

View File

@@ -15,6 +15,7 @@ templates = []
for file in files: for file in files:
# Open the file # Open the file
with open(templates_src_dir + file) as f: with open(templates_src_dir + file) as f:
if file.endswith('.json'):
# Load the JSON into a variable # Load the JSON into a variable
data = json.load(f)['templates'] data = json.load(f)['templates']
# Append the template object to the templates list # Append the template object to the templates list