aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/build.sh b/build.sh
index 9fe81c3..f38b5e0 100755
--- a/build.sh
+++ b/build.sh
@@ -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