addition for concat example

This commit is contained in:
Matthias Wirth
2020-11-30 22:41:53 +01:00
parent 53cfad8939
commit 55457ac9d8
2 changed files with 7 additions and 1 deletions

View File

@@ -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<link rel="stylesheet" href="all.css" type="text/css" />$' 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

View File

@@ -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