Fix CSS/JS cache busting - sync versions on launch

.launch.sh now updates CSS and JS query params to match app version.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
primal
2026-02-01 17:58:55 -05:00
parent 3a28518366
commit 02564bfde7
2 changed files with 18 additions and 3 deletions
Executable
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
cd "$(dirname "$0")"
# Increment version number in templates.go
VERSION=$(grep -oE 'v[0-9]+</div>' templates.go | grep -oE '[0-9]+')
NEW_VERSION=$((VERSION + 1))
sed -i '' "s/v${VERSION}<\\/div>/v${NEW_VERSION}<\\/div>/" templates.go
# Update CSS and JS cache-busting versions
sed -i '' "s/dashboard\\.css?v=[0-9]*/dashboard.css?v=${NEW_VERSION}/" templates.go
sed -i '' "s/dashboard\\.js?v=[0-9]*/dashboard.js?v=${NEW_VERSION}/" templates.go
echo "Version: v${VERSION} → v${NEW_VERSION}"
~/apps/.launch.sh "$@"