summaryrefslogtreecommitdiff
path: root/publish
diff options
context:
space:
mode:
Diffstat (limited to 'publish')
-rwxr-xr-xpublish30
1 files changed, 21 insertions, 9 deletions
diff --git a/publish b/publish
index 8b98f7c..2cb7959 100755
--- a/publish
+++ b/publish
@@ -3,8 +3,13 @@
HERE=$(dirname $(readlink -f ${0}))/src;
HTML=html;
-rm -fr ${HTML} ${HTML}.tgz;
-mkdir ${HTML};
+TEMP=$(mktemp -d);
+rm -f ${HTML}.tgz;
+
+##
+# Styles
+#
+(cd assets/css && ./compile.sh)
##
# Logo
@@ -16,8 +21,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 +30,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 +46,24 @@ 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 .;
)
+
+##
+# Cutover.
+#
+rm -fr ${HTML};
+mv ${TEMP} ${HTML};
+chmod 755 ${HTML};