aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2021-02-09 11:01:09 +0100
committerJakob Stendahl <jakob.stendahl@outlook.com>2021-02-09 11:01:09 +0100
commitcddd10b1919b2001b5b16b1845cd2c99e8dbecac (patch)
tree0b4d888cabee31abf6c00acecd243142f5d3302c
parent10a6f851c4b4c098f09270a3928a44d205ca9d80 (diff)
downloadhoverbit-ble-cddd10b1919b2001b5b16b1845cd2c99e8dbecac.tar.gz
hoverbit-ble-cddd10b1919b2001b5b16b1845cd2c99e8dbecac.zip
:hammer: Remove basepath from cache
-rwxr-xr-xpostbuild.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/postbuild.sh b/postbuild.sh
index 929abaa..614bbc7 100755
--- a/postbuild.sh
+++ b/postbuild.sh
@@ -18,12 +18,16 @@ sed -i".bak" "s/{{ VERSION }}/$VERSION/g" index.html
sed -i".bak" "s/{{ VERSION }}/$VERSION/g" service-worker.js
tput setaf 4; echo "> Add cache-files to webmanifest..."; tput sgr0
-cache_files="'$PUBLISH_URL'";
+cache_files="";
for file in *; do
if [[ "$file" =~ (manifest.webmanifest|*.git) ]]; then
continue
fi
- cache_files="$cache_files,""'$PUBLISH_URL$file'"
+ if [[ "$cache_files" == "" ]]; then
+ cache_files="'$PUBLISH_URL$file'"
+ else
+ cache_files="$cache_files,""'$PUBLISH_URL$file'"
+ fi
done
sed -i".bak" "s|\"{{ CACHE_FILES }}\"|$cache_files|g" service-worker.js