From 55457ac9d8d7566542be7f046994e086d035cbe3 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Mon, 30 Nov 2020 22:41:53 +0100 Subject: [PATCH] addition for concat example --- concat-example.sh | 6 ++++++ install.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/concat-example.sh b/concat-example.sh index 5e614aa..cc56c87 100644 --- a/concat-example.sh +++ b/concat-example.sh @@ -1,3 +1,4 @@ +# cache busting and concatenation example function magic() { FN="$1.$2" MD5="$1_$(md5sum "$FN" | cut -f1 -d' ').$2" @@ -21,3 +22,8 @@ done sed -i -e 's$.*JS_ANCHOR.*$\0\n$' index.html magic all js + +DB_VERSION=$(date +%s) +# or better +DB_VERSION=$(git rev-parse --short HEAD) +sed -i -e "s/let databaseFolder = .*;/let databaseFolder = \"db-$DB_VERSION\";/" index.html diff --git a/install.sh b/install.sh index ba19c9a..a904394 100755 --- a/install.sh +++ b/install.sh @@ -103,7 +103,7 @@ else echo "Unable to download files, exiting! (Maybe try again?)" exit 1 fi - TAR_VERSION="$(git rev-parse --short HEAD)_$DB_VERSION" + TAR_VERSION="$(git rev-parse --short HEAD)" fi