From e5bb396ac66f8877b69ced0762b3ad21599dab9a Mon Sep 17 00:00:00 2001 From: ritual Date: Sat, 21 Feb 2026 21:34:17 +0000 Subject: [PATCH] Deploy script for server to bust the stupid cache --- deploy.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..dfddf8e --- /dev/null +++ b/deploy.sh @@ -0,0 +1,20 @@ +#!/bin/sh +set -e + +cd "$(dirname "$0")" + +# Reset any previously stamped files so git pull succeeds cleanly +git checkout -- index.html sw.js + +git pull + +V=$(git rev-parse --short HEAD) + +# Stamp asset query strings in index.html +sed -i 's|href="style\.css[^"]*"|href="style.css?v='"$V"'"|' index.html +sed -i 's|src="script\.js[^"]*"|src="script.js?v='"$V"'"|' index.html + +# Bump service worker cache name +sed -i "s/status-poster-v[^']*/status-poster-$V/" sw.js + +echo "Deployed $V"