aboutsummaryrefslogtreecommitdiff
path: root/v1/combine-feature-fragments.py
blob: 39bc8d02ace84c4a88894ad0a8f4d6cf5456dfb7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/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}')