This is especially important for distributions like NixOS where `/bin/bash` doesn't exist, or for MacOS users who've installed a newer version of Bash than the one that comes with their OS. Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com> Upstream-commit: 52379fa76dee07ca038624d639d9e14f4fb719ff Component: engine
13 lines
306 B
Bash
Executable File
13 lines
306 B
Bash
Executable File
#!/usr/bin/env 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."
|