blob: dd7df4e5e65201bd6b9bfe2d1c394d65bf9b91d2 [file] [log] [blame]
avm999636c357302020-08-09 19:54:08 +02001#!/bin/bash
2
3# Generates the manifest.json file according to the dependencies passed
4# via CLI arguments
5
6dependencies=( "$@" )
7
8rm -f src/manifest.json
9cp templates/manifest.gjson src/manifest.json
10
11for dep in "${dependencies[@]}"; do
12 perl -0777 -pi -e "s/^#if defined\($dep\)\n([^#]*)#endif\n/\$1/gms" src/manifest.json
13done
14
15perl -0777 -pi -e "s/^#if defined\([^\n#]+\)\n[^#]*#endif\n//gms" src/manifest.json