diff options
| author | Paul Buetow (mars.fritz.box) <paul@buetow.org> | 2013-12-22 17:50:50 +0100 |
|---|---|---|
| committer | Paul Buetow (mars.fritz.box) <paul@buetow.org> | 2013-12-22 17:50:50 +0100 |
| commit | 14250af451c56b00f9e94d7b27dc24465d954a81 (patch) | |
| tree | 00d322d3d3f485a9bd33b1f6b53a21cd93d4cd15 | |
| parent | 42a68c4c4d2a8bff01070e2ab4d5239e62c9b54f (diff) | |
add tarball function
| -rwxr-xr-x | photoalbum.sh | 23 |
1 files 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 |
