aboutsummaryrefslogblamecommitdiff
path: root/v1/combine-feature-fragments.py
blob: 39bc8d02ace84c4a88894ad0a8f4d6cf5456dfb7 (plain) (tree)
1
2
3
4
5
6
7





                      
                                 
















                        
                                         






                                   
#!/usr/bin/env python3

# Run from repo root.

import os

featureDirs = os.listdir('./src')

beginning = """
{
	"features": [
"""

middle = ""

end = """
	]
}
"""

count = len(featureDirs)

for fDir in featureDirs:
    count -= 1
    config = f'./src/{fDir}/feature.json'
    data = open(config, "r").read()
    middle += f'{data}'
    if count != 0:
        middle += ','
    middle += '\n'

print(f'{beginning}{middle}{end}')