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