blob: dd7df4e5e65201bd6b9bfe2d1c394d65bf9b91d2 [file] [log] [blame]
#!/bin/bash
# Generates the manifest.json file according to the dependencies passed
# via CLI arguments
dependencies=( "$@" )
rm -f src/manifest.json
cp templates/manifest.gjson src/manifest.json
for dep in "${dependencies[@]}"; do
perl -0777 -pi -e "s/^#if defined\($dep\)\n([^#]*)#endif\n/\$1/gms" src/manifest.json
done
perl -0777 -pi -e "s/^#if defined\([^\n#]+\)\n[^#]*#endif\n//gms" src/manifest.json