From 14250af451c56b00f9e94d7b27dc24465d954a81 Mon Sep 17 00:00:00 2001 From: "Paul Buetow (mars.fritz.box)" Date: Sun, 22 Dec 2013 17:50:50 +0100 Subject: add tarball function --- photoalbum.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/photoalbum.sh b/photoalbum.sh index 7580f23..57d953e 100755 --- a/photoalbum.sh +++ b/photoalbum.sh @@ -113,7 +113,6 @@ function generate () { redirectpage=$(( page+1 ))-1 else redirectpage=${page}-${lastview} - echo "template redirect 0-${MAXPREVIEWS}" template redirect 0-${MAXPREVIEWS} redirectpage=1-1 @@ -123,18 +122,22 @@ function generate () { done } +function tarball () { + # Cleanup tarball from prev run if any + find ./dist/ -maxdepth 1 -type f -name \*.tar -delete + + if [ "${INCLUDETARBALL}" = 'yes' ]; then + echo Creating tarball + mv "${INCOMING}" "${TARBALLNAME}" + tar $TAROPTS -f "./dist/${TARBALLNAME}${TARBALLSUFFIX}" "${TARBALLNAME}" + mv "${TARBALLNAME}" "${INCOMING}" + fi +} + createdirs scale find ./dist/ -type f -name \*.html -delete template index index ./dist generate +tarball -# Cleanup tarball from prev run if any -find ./dist/ -maxdepth 1 -type f -name \*.tar -delete - -if [ "${INCLUDETARBALL}" = 'yes' ]; then - echo Creating tarball - mv "${INCOMING}" "${TARBALLNAME}" - tar $TAROPTS -f "./dist/${TARBALLNAME}${TARBALLSUFFIX}" "${TARBALLNAME}" - mv "${TARBALLNAME}" "${INCOMING}" -fi -- cgit v1.2.3