Skip to content

Commit

Permalink
Fix GetCatalog and enhance the way initial releases are handled
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtbahartr committed Dec 10, 2024
1 parent 597e9e3 commit 227b5bf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.mkdn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
v1.0.0-24H2
https://github.com/kurtbahartr/windows-configs/releases/v1.0.0-24H2
-------------------------------------------------------------------
- Initial release based on Windows 11, version 24H2.
Version 1.0.0-24H2
https://github.com/kurtbahartr/windows-configs/releases/tag/v1.0.0-24H2
-----------------------------------------------------------------------
- Initial release based on Windows 11, version 24H2.
21 changes: 15 additions & 6 deletions scripts/GetCatalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,23 @@ repo=$(gh repo view -q '.name' --json name)
PREV_VERSION=$(gh release view -q '.tagName' --json tagName | sed 's/^V//')

# Extract the content between the specified version and the next version, excluding the release URL and dashes
awk -v header="$VERSION_HEADER" -v website="$website" -v owner="$owner" -v repo="$repo" '
BEGIN {found=0}
$0 == header {found=1; next}
/^Version/ && found {exit}
found && !($0 ~ website owner repo "/releases/tag/v.*" && $0 ~ /[0-9]+\.[0-9]+/) && !/^-----.*/ {print}
' "$CHANGELOG_FILE"
if [ -z "$PREV_VERSION" ]; then
awk -v header="$VERSION_HEADER" -v website="$website" -v owner="$owner" -v repo="$repo" '
$0 == header {next}
!($0 ~ website "/" owner "/" repo "/releases/tag/v.*" && $0 ~ /[0-9]+\.[0-9]+/) && !/^-----.*/ {print}
' "$CHANGELOG_FILE"
else
awk -v header="$VERSION_HEADER" -v website="$website" -v owner="$owner" -v repo="$repo" '
BEGIN {found=0}
$0 == header {found=1; next}
/^Version/ && found {exit}
found && !($0 ~ website owner repo "/releases/tag/v.*" && $0 ~ /[0-9]+\.[0-9]+/) && !/^-----.*/ {print}
' "$CHANGELOG_FILE"
fi

# Add the "Full Changelog" line comparing the previous version with the current one only if a previous version exists
if [[ -n "$PREV_VERSION" ]]; then
echo "**Full Changelog**: $REMOTE_URL/compare/v$PREV_VERSION...v$VERSION"
else
echo -e "\n**Full Changelog**: $REMOTE_URL/commits/v$VERSION"
fi

0 comments on commit 227b5bf

Please sign in to comment.