File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,20 @@ def write_yaml(file_path: str | Path, data):
167167 yaml .dump (data , file )
168168
169169
170+ def write_json (file_path : str | Path , data ):
171+ """Write data as JSON to file_path
172+
173+ Parameters
174+ ----------
175+ file_path : str, Path
176+ Filesystem path to the JSON file
177+ data : dict, list
178+ The object to write as JSON
179+ """
180+ with open (file_path , "w" ) as file :
181+ json .dump (data , file )
182+
183+
170184def dig (obj : dict , * keys ):
171185 """Digs data out of dictionary obj
172186
@@ -611,5 +625,6 @@ def resolve_file(
611625
612626 # create index
613627 write_yaml (f"{ abs_resolved_dir } /index.yaml" , arch_paths )
628+ write_json (f"{ abs_resolved_dir } /index.json" , arch_paths )
614629
615630 print (f"[INFO] Resolved architecture files written to { args .resolved_dir } " )
You can’t perform that action at this time.
0 commit comments