cmc/cleberg.net

My personal web garden & blog.

clone: git clone https://gitbay.org/cmc/cleberg.net.git

e86c55dbfad35870e76bd0e69991416f60017512

unsigned

author: Christian Cleberg <hello@cleberg.net> · 2024-07-29T00:45:52Z

add safety check to build.sh
 build.sh | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..81c09c6
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+printf "Did you update the 'Recent Blog Posts' section? [yn]"
+read answer
+
+if [ "$answer" != "${answer#[Yy]}" ] ; then
+	if [ "$ENV" == "prod" ]; then
+		echo "Environment = Production"              && \
+		rm -rf .build/*                              && \
+		emacs --script publish.el                    && \
+		rsync -av --delete-before public/* ubuntu:/var/www/cleberg.net/
+	else
+		echo "Environment = Development"             && \
+		rm -rf .build/*                              && \
+		emacs --script publish.el		     && \
+		cd .build/				     && \
+		python3 -m http.server
+	fi
+else
+	echo No
+fi