aboutsummaryrefslogtreecommitdiff
path: root/v1/combine-feature-fragments.py
diff options
context:
space:
mode:
authorJosh Spicer <josh@joshspicer.com>2022-05-10 02:10:29 +0300
committerGitHub <noreply@github.com>2022-05-10 02:10:29 +0300
commit11222df509fc7a0f44e794eae78925c4fe9dcb00 (patch)
tree52e7b9e387fb32c281a028613fe1eebcd3372cfc /v1/combine-feature-fragments.py
parent9efe4b3c4a5f07c45cf6ed69900006eed0e844b9 (diff)
add release action (#2)
Diffstat (limited to 'v1/combine-feature-fragments.py')
-rwxr-xr-xv1/combine-feature-fragments.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/v1/combine-feature-fragments.py b/v1/combine-feature-fragments.py
new file mode 100755
index 0000000..bbc9913
--- /dev/null
+++ b/v1/combine-feature-fragments.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+
+# Run from repo root.
+
+import os
+
+featureDirs = os.listdir('./collection')
+
+beginning = """
+{
+ "features": [
+"""
+
+middle = ""
+
+end = """
+ ]
+}
+"""
+
+count = len(featureDirs)
+
+for fDir in featureDirs:
+ count -= 1
+ config = f'./collection/{fDir}/feature.json'
+ data = open(config, "r").read()
+ middle += f'{data}'
+ if count != 0:
+ middle += ','
+ middle += '\n'
+
+print(f'{beginning}{middle}{end}')