aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorChristian Cleberg <hello@cleberg.net>2024-07-28 19:45:52 -0500
committerChristian Cleberg <hello@cleberg.net>2024-07-28 19:45:52 -0500
commitafe76ac7d7498b862abaa623790b91410e34574d (patch)
tree4fa6d59b4954e9756061875621e115b1b30561c7 /build.sh
parentc6a33b78b9a75f5105a6847da9677c014327242e (diff)
downloadcleberg.net-afe76ac7d7498b862abaa623790b91410e34574d.tar.gz
cleberg.net-afe76ac7d7498b862abaa623790b91410e34574d.tar.bz2
cleberg.net-afe76ac7d7498b862abaa623790b91410e34574d.zip
add safety check to build.sh
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh21
1 files changed, 21 insertions, 0 deletions
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