1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/loki_ynh.git synced 2024-09-03 19:36:16 +02:00
loki_ynh/sources/extra_files/loki-amd64/merge_yaml.sh
Florent 4b63266ca7
Testing (#4)
Add promtail and update links
2022-12-31 11:31:16 +01:00

14 lines
355 B
Bash

#!/bin/bash
shopt -s nullglob
file_list=($@)
{
for file in "${file_list[@]}"
do
/usr/bin/python3 -c "import yaml, json; print(json.dumps(yaml.safe_load(open('$file')), default=str))"
done
} \
| /usr/bin/jq --slurp 'reduce .[] as $item ({}; . * $item)' \
| /usr/bin/python3 -c "import yaml, json; print(yaml.dump(json.load(open('/dev/stdin'))))"