add asset-release helper script
This commit is contained in:
parent
8e412e199c
commit
4cd88a8f50
1 changed files with 17 additions and 0 deletions
17
scripts/asset-release
Executable file
17
scripts/asset-release
Executable file
|
@ -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
|
Loading…
Reference in a new issue