mach/gpu-dawn/dev/dir_to_json.py
Stephen Gutekanst 028b7d8034 gpu-dawn: CI: upload headers.json + tarball
Fixes hexops/mach#171
Helps hexops/mach#109

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-02-27 19:29:58 -07:00

12 lines
273 B
Python

import os
import json
def dir_to_dict(d):
dict = {}
for dirpath,_,filenames in os.walk(d):
for f in filenames:
path = os.path.join(dirpath, f)
dict[path] = open(path, 'r').read()
return dict
print(json.dumps(dir_to_dict('.')))