ソースを参照

Fix, only parse valid JSON files

Alicia Sykes 2 年 前
コミット
7a484975e2
1 ファイル変更5 行追加4 行削除
  1. 5 4
      lib/combine.py

+ 5 - 4
lib/combine.py

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