summaryrefslogtreecommitdiff
path: root/scripts/asset-release
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-05-11 12:33:18 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-05-11 12:33:18 +0200
commit4cd88a8f50f5c07555cff93611e8d9af5ba5c518 (patch)
treeb56e15ed47029370402233a68f0e33ce85147112 /scripts/asset-release
parent8e412e199ce447cb64f040bae86f1478aa598fa4 (diff)
add asset-release helper script
Diffstat (limited to 'scripts/asset-release')
-rwxr-xr-xscripts/asset-release17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/asset-release b/scripts/asset-release
new file mode 100755
index 0000000..5a65bca
--- /dev/null
+++ b/scripts/asset-release
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -ex
+
+current="$(ls -d public/static/v* | tail -n 1 | grep -o '..$')"
+prev=$((current - 1))
+next=$((current + 1))
+
+git mv public/static/v${prev} public/static/v${next}
+
+sed -i "s!/v${current}/!/v${next}/!g" \
+ public/service-worker.js public/static/manifest.json \
+ public/static/css/material-icons.css
+
+sed -i "s!static-cache-v${current}!static-cache-v${next}!" public/service-worker.js
+
+sed -i "s!av = 'v${current}'!av = 'v${next}'!" templates/layouts/default.html.ep