1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/hack/validate/changelog-date-descending
Andrew Hsu 6cca6bf942 validate changelog dates are in descending order
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2017-01-23 19:19:35 -08:00

12 lines
298 B
Bash
Executable file

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