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