Merge pull request #2691 from Bnyro/master

Improve the script to generate changelogs
This commit is contained in:
Bnyro 2023-01-14 16:02:18 +01:00 committed by GitHub
commit 6e0610e26c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,12 +10,6 @@ TEXT=$(printf "${TEXT[@]}" | sed 's/.*Weblate.*//g' | sed 's/.*dependency.*//g')
# go through all the lines inside the file # go through all the lines inside the file
readarray -t y <<< "${TEXT[@]}" readarray -t y <<< "${TEXT[@]}"
echoall() {
for line in "$@"; do
echo "$line"
done
}
FIXES=() FIXES=()
FEATURES=() FEATURES=()
IMPROVEMENTS=() IMPROVEMENTS=()
@ -34,21 +28,37 @@ for line in "${y[@]}" ; do
fi fi
done done
# function for echoing all items of an array, one per line
echoall() {
for line in "$@"; do
echo "$line"
done
}
# Print all the found and categorized changes # Print all the found and categorized changes
echo "## New features" create_changelog() {
echoall "${FEATURES[@]}" echo "## New features"
echo "" echoall "${FEATURES[@]}"
echo ""
echo "## Minor changes" echo "## Minor changes"
echoall "${IMPROVEMENTS[@]}" echoall "${IMPROVEMENTS[@]}"
echo "" echo ""
echo "## Bug fixes" echo "## Bug fixes"
echoall "${FIXES[@]}" echoall "${FIXES[@]}"
echo "" echo ""
echo "## Repo changes" echo "## Repo changes"
echoall "${REPOCHANGES[@]}" echoall "${REPOCHANGES[@]}"
echo "" echo ""
echo "$FULLCHANGELOG" echo "$FULLCHANGELOG"
}
# generate a new changelog
CHANGELOG=$(create_changelog)
# write the changelog into the file
echo "$CHANGELOG" > "$1"
echo "Done."