pollux.codes

Files for the pollux.codes site
git clone git://pollux.codes/git/pollux.codes.git
Log | Files | Refs

commit 17e64af70632097ff7e6fabe960361cf767de919
parent 71737f9d03d915be96d13508b0eba9c3ac75f36e
Author: Pollux <pollux@pollux.codes>
Date:   Thu, 23 Jan 2025 14:54:16 -0600

Add safety checks to deploy script

Signed-off-by: Pollux <pollux@pollux.codes>

Diffstat:
Mdeploy.sh | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/deploy.sh b/deploy.sh @@ -5,6 +5,16 @@ if [ ! -f hugo.toml ]; then exit 1 fi +if [ "$(git status --porcelain | wc -l)" -gt 0 ]; then + echo "There are uncommited changes... Exiting." + exit 1 +fi + +if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then + echo "Not on branch master... Exiting." + exit 1 +fi + if [ -d public/ ]; then echo "Cleaning old build." rm -r public/