changelog-date-descending 306 B

123456789101112
  1. #!/usr/bin/env bash
  2. changelogFile=${1:-CHANGELOG.md}
  3. if [ ! -r "$changelogFile" ]; then
  4. echo "Unable to read file $changelogFile" >&2
  5. exit 1
  6. fi
  7. grep -e '^## ' "$changelogFile" | awk '{print$3}' | sort -c -r || exit 2
  8. echo "Congratulations! Changelog $changelogFile dates are in descending order."