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