blob: 29839c05e816875ae8513a9a296312248ba0423c [file] [log] [blame]
avm999636c357302020-08-09 19:54:08 +02001#!/bin/bash
avm99963b69eb3d2020-08-20 02:03:44 +02002#
avm999636c357302020-08-09 19:54:08 +02003# Generates the manifest.json file according to the dependencies passed
4# via CLI arguments
5
avm99963b69eb3d2020-08-20 02:03:44 +02006dependencies=("$@")
avm999636c357302020-08-09 19:54:08 +02007
8rm -f src/manifest.json
9cp templates/manifest.gjson src/manifest.json
10
11for dep in "${dependencies[@]}"; do
avm99963b69eb3d2020-08-20 02:03:44 +020012 perl -0777 -pi -e "s/^#if defined\($dep\)\n([^#]*)#endif\n/\$1/gms" \
13 src/manifest.json
avm999636c357302020-08-09 19:54:08 +020014done
15
avm99963b69eb3d2020-08-20 02:03:44 +020016perl -0777 -pi -e "s/^#if defined\([^\n#]+\)\n[^#]*#endif\n//gms" \
17 src/manifest.json