From 0851389d8b1e1e9163312c2b796560906621dbec Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Sun, 1 Aug 2021 12:56:05 -0500 Subject: Atomic website updates. --- publish | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/publish b/publish index 8b98f7c..b511e65 100755 --- a/publish +++ b/publish @@ -3,8 +3,8 @@ HERE=$(dirname $(readlink -f ${0}))/src; HTML=html; -rm -fr ${HTML} ${HTML}.tgz; -mkdir ${HTML}; +rm -f ${HTML}.tgz; +TEMP=$(mktemp -d); ## # Logo @@ -16,8 +16,8 @@ mkdir ${HTML}; # find ${HERE} -type f -name "*.psd" | while read k; do f="${k#*${HERE}}"; - mkdir -p "${HTML}${f%/*}"; - convert "${k}[0]" -strip "${HTML}${f%*.psd}.jpg"; + mkdir -p "${TEMP}${f%/*}"; + convert "${k}[0]" -strip "${TEMP}${f%*.psd}.jpg"; done ## @@ -25,8 +25,8 @@ done # find ${HERE} -type f -name "*.html" | while read k; do f="${k#*${HERE}}"; - mkdir -p "${HTML}${f%/*}"; - sed > "${HTML}${f}" "${k}" \ + mkdir -p "${TEMP}${f%/*}"; + sed > "${TEMP}${f}" "${k}" \ -e "/__HEADER__/r ${HERE}/header.fill" \ -e 's/__HEADER__//g' \ -e "/__FOOTER__/r ${HERE}/footer.fill" \ @@ -41,17 +41,23 @@ done ## # static assets # -cp -R ${HERE}/../assets ${HTML}; +cp -R ${HERE}/../assets ${TEMP}; ## # # -cp ${HERE}/robots.txt ${HTML}; +cp ${HERE}/robots.txt ${TEMP}; ## # payload # ( - cd ${HTML}; + cd ${TEMP}; tar -pczf ../${HTML}.tgz .; ) + +## +# publish +# +rm -fr ${HTML}; +mv ${TEMP} ${HTML}; -- cgit v1.2.3-70-g09d2