From 98199426876d298cbdc88f54b5e353a339fe8661 Mon Sep 17 00:00:00 2001 From: Lou DeGenaro Date: Thu, 16 Nov 2023 14:55:43 -0500 Subject: [PATCH] fix: handle nothing to do Signed-off-by: Lou DeGenaro --- scripts/automation/push.sh | 10 ++++++++++ scripts/automation/release.sh | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/automation/push.sh b/scripts/automation/push.sh index 8baf435..f5ded9e 100755 --- a/scripts/automation/push.sh +++ b/scripts/automation/push.sh @@ -2,6 +2,16 @@ source config.env +# If there is no catalog or markdown, then there is nothing to do +COUNT_CATALOG_MD=$(ls -l md_catalogs | grep ^- | wc -l) +COUNT_CATALOGS=$(ls -l catalogs | grep ^- | wc -l) +let "INITIALIZED = $COUNT_CATALOG_MD + $COUNT_CATALOGS" +if [ $INITIALIZED -eq 0 ] +then + echo "push: no catalog or markdown, nothing to do" + exit 0 +fi + function github-branch-commit() { msg "Github ref $GITHUB_REF" GIT_BRANCH=${GITHUB_REF##*/} diff --git a/scripts/automation/release.sh b/scripts/automation/release.sh index a1c528e..20e48d6 100755 --- a/scripts/automation/release.sh +++ b/scripts/automation/release.sh @@ -8,7 +8,7 @@ COUNT_CATALOGS=$(ls -l catalogs | grep ^- | wc -l) let "INITIALIZED = $COUNT_CATALOG_MD + $COUNT_CATALOGS" if [ $INITIALIZED -eq 0 ] then - echo "no catalog or markdown, nothing to do" + echo "release: no catalog or markdown, nothing to do" exit 0 fi