From bd714a7eb767bc04ea1de58519a9ec2542d64d27 Mon Sep 17 00:00:00 2001 From: Lou DeGenaro Date: Fri, 17 Nov 2023 08:58:06 -0500 Subject: [PATCH] fix: detect catalog or markdown present Signed-off-by: Lou DeGenaro --- scripts/automation/push.sh | 8 +++----- scripts/automation/release.sh | 12 +++++------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/scripts/automation/push.sh b/scripts/automation/push.sh index d3a72fe..b67b43f 100755 --- a/scripts/automation/push.sh +++ b/scripts/automation/push.sh @@ -86,13 +86,11 @@ function err() { msg "$*" 1>&2 } -# 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 ] +COUNT_CATALOG_MD=$(ls -l md_catalogs | grep ^- | wc -l) +if [ "$COUNT_CATALOGS" == "0" ] || [ "$COUNT_CATALOG_MD" == "0" ] then - echo "push: no catalog or markdown, nothing to do" + echo "no catalog or markdown present -> nothing to do" else github-branch-commit fi diff --git a/scripts/automation/release.sh b/scripts/automation/release.sh index 42682c1..543580f 100755 --- a/scripts/automation/release.sh +++ b/scripts/automation/release.sh @@ -2,15 +2,13 @@ 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 ] +COUNT_CATALOG_MD=$(ls -l md_catalogs | grep ^- | wc -l) +if [ "$COUNT_CATALOGS" == "0" ] || [ "$COUNT_CATALOG_MD" == "0" ] then - echo "release: no catalog or markdown, nothing to do" + echo "no catalog or markdown present -> nothing to do" else - version_tag=$(semantic-release print-version) + version_tag=$(semantic-release print-version) echo "Bumping version of catalogs to ${version_tag}" export VERSION_TAG="$version_tag" echo "VERSION_TAG=${VERSION_TAG}" >> $GITHUB_ENV @@ -24,4 +22,4 @@ else git config --global user.email "$EMAIL" git config --global user.name "$NAME" semantic-release publish -fi \ No newline at end of file +fi