From 1aac2f1afb2a3476313eceb2a248a1104861712e Mon Sep 17 00:00:00 2001 From: Nick Dumas Date: Sun, 5 Feb 2023 22:35:19 +0000 Subject: [PATCH] smart commit, actually smart now --- smart-commit | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/smart-commit b/smart-commit index e724356..d900a17 100644 --- a/smart-commit +++ b/smart-commit @@ -1,10 +1,14 @@ #! /bin/sh +set -e -u -o pipefail +cd /tmp/blog/ STATUS=$(git status --porcelain) STATUS_LEN=${#STATUS} -if [ $STATUS_LEN = 0 ]; then +if [[ $STATUS_LEN -eq 0 ]] +then exit 0 else - git add . - git commit -qm "CI/CD Commit: $(date -Iseconds)" + git add content/* + git commit -m "CI/CD Commit: $(date -Iseconds)" + git push origin main fi