collect-changelog 565 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. collectType() {
  3. local suffix="$1"
  4. local header="$2"
  5. local printed=0
  6. for file in changelog.d/*."$suffix"; do
  7. if [ '!' -f "$file" ]; then
  8. continue
  9. fi
  10. if [ "$printed" = 0 ]; then
  11. echo
  12. echo "### $header"
  13. printed=1
  14. fi
  15. # Normalize any trailing newlines/spaces, etc.
  16. echo "- $(cat "$file")"
  17. done
  18. }
  19. collectType security Security
  20. collectType change Changed
  21. collectType add Added
  22. collectType fix Fixed
  23. collectType remove Removed
  24. rm changelog.d/*