Add bin directory

This commit is contained in:
2019-12-18 10:04:20 +01:00
parent 075c9bc55e
commit 9300b749d6
9 changed files with 123 additions and 0 deletions

14
bin/split-multiyaml-to-json Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env python3
import sys
import yaml
import json
data = list(yaml.load_all(sys.stdin))
files = sys.argv[1:]
for i in range(len(data)):
doc = data[i]
path = files[i]
with open(path, 'w') as f:
json.dump(doc, f, indent=4)