From 2059fab6c01a0793e8a82f80d9518ed2bd6d1e29 Mon Sep 17 00:00:00 2001 From: jahoti Date: Sun, 4 Jul 2021 00:00:00 +0000 Subject: Revamp default settings Default settings are now provided in the same format as data exported from the extension, incorporating them into the main program as part of the build process. Also, modify their contents; the apparently non-functional FSF stuff is gone, replaced with fixes for BandCamp, WorldCat, and SumOfUs. --- build.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'build.sh') 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 -- cgit v1.2.3