File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -397,6 +397,17 @@ def get_context(config_fname: str, **kwargs):
397397 context ["source_path" ] = os .path .dirname (config_fname )
398398 context .update (kwargs )
399399
400+ # Validate versions.json
401+ versions_path = os .path .join (context ["source_path" ], "versions.json" )
402+ sys .stderr .write (f"[DEBUG] Checking JSON at { versions_path } \n " )
403+ if os .path .exists (versions_path ):
404+ try :
405+ with open (versions_path , encoding = "utf-8" ) as f :
406+ json .load (f )
407+ except json .JSONDecodeError as e :
408+ sys .stderr .write (f"\n [ERROR] Invalid JSON in { versions_path } :\n { e } \n " )
409+ sys .exit (1 )
410+
400411 preprocessors = (
401412 get_callable (context_prep )
402413 for context_prep in context ["main" ]["context_preprocessors" ]
You can’t perform that action at this time.
0 commit comments