From cddd10b1919b2001b5b16b1845cd2c99e8dbecac Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Tue, 9 Feb 2021 11:01:09 +0100 Subject: :hammer: Remove basepath from cache --- postbuild.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'postbuild.sh') 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 -- cgit v1.2.3