2019-05-11 10:33:18 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-06-24 16:36:59 +00:00
|
|
|
# Copyright (C) 2020 Birthe Friesel <derf@finalrewind.org>
|
2020-11-27 21:12:56 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2019-05-11 10:33:18 +00:00
|
|
|
set -ex
|
|
|
|
|
2019-05-12 09:48:17 +00:00
|
|
|
current="$(find public/static/v* | tail -n 1 | grep -o '..$')"
|
2019-05-11 10:33:18 +00:00
|
|
|
prev=$((current - 1))
|
|
|
|
next=$((current + 1))
|
|
|
|
|
|
|
|
git mv public/static/v${prev} public/static/v${next}
|
|
|
|
|
2019-05-11 10:51:41 +00:00
|
|
|
perl -pi -e "s!/v${current}/!/v${next}/!g" \
|
2019-05-11 10:33:18 +00:00
|
|
|
public/service-worker.js public/static/manifest.json \
|
|
|
|
public/static/css/material-icons.css
|
|
|
|
|
2019-05-11 10:51:41 +00:00
|
|
|
perl -pi -e "s!static-cache-v${current}!static-cache-v${next}!" public/service-worker.js
|
2019-05-11 10:33:18 +00:00
|
|
|
|
2019-05-11 10:51:41 +00:00
|
|
|
perl -pi -e "s!av = 'v${current}'!av = 'v${next}'!" templates/layouts/default.html.ep
|