Skip to content

Commit

Permalink
fix: detect catalog or markdown present
Browse files Browse the repository at this point in the history
Signed-off-by: Lou DeGenaro <[email protected]>
  • Loading branch information
degenaro committed Nov 17, 2023
1 parent 10ebf4e commit bd714a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
8 changes: 3 additions & 5 deletions scripts/automation/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 5 additions & 7 deletions scripts/automation/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,4 +22,4 @@ else
git config --global user.email "$EMAIL"
git config --global user.name "$NAME"
semantic-release publish
fi
fi

0 comments on commit bd714a7

Please sign in to comment.