diff options
author | Zach van Rijn <me@zv.io> | 2021-08-01 12:56:05 -0500 |
---|---|---|
committer | Zach van Rijn <me@zv.io> | 2021-08-01 12:56:05 -0500 |
commit | 0851389d8b1e1e9163312c2b796560906621dbec (patch) | |
tree | 46d8f557c988dca7d30842c236c999c65122a5cd | |
parent | 597ae62cd398d03842457c4766b08c4c934c188e (diff) | |
download | site-ng-0851389d8b1e1e9163312c2b796560906621dbec.tar.gz site-ng-0851389d8b1e1e9163312c2b796560906621dbec.tar.bz2 site-ng-0851389d8b1e1e9163312c2b796560906621dbec.tar.xz site-ng-0851389d8b1e1e9163312c2b796560906621dbec.zip |
Atomic website updates.
-rwxr-xr-x | publish | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -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}; |