diff options
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -271,7 +271,17 @@ s^_CONTENTSCRIPTS_^$CONTENTSCRIPTS^" \ (() => { $(map_get IMPORTCODES $FILEKEY) -"; cat $FILE; echo " +"; + +# A hack to insert the contents of default_settings.json at the appropriate location in background/main.js +if [ "$FILE" = "background/main.js" ]; then + # Uses an internal sed expression to escape and indent the JSON file for use in the external sed expression + sed 's/^ `DEFAULT SETTINGS`$/'"$(sed -E 's/([\\\&\/])/\\\1/g; s/^/ /; s/$/\\/' < default_settings.json) "/g < "$FILE" +else + cat $FILE +fi + +echo " $(map_get EXPORTCODES $FILEKEY) })();") > $BUILDDIR/$FILE |