aboutsummaryrefslogtreecommitdiff
path: root/postbuild.sh
diff options
context:
space:
mode:
Diffstat (limited to 'postbuild.sh')
-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