Last active
March 5, 2020 09:55
-
-
Save sphrak/585ff91e77088d0877dd5869c3c2c0da to your computer and use it in GitHub Desktop.
a tiny script for outputting changelog diff between releases for (semver)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage | |
# chmod +x semverdiff.sh | |
# Get diff between 1.0.0..1.0.1 | |
# ./semverdiff 1.0.1 | |
get_diff() { | |
sed -n "/^## \[$1\]/,/^## /p" CHANGELOG.md | egrep "^(-|\s+)" | |
} | |
if [[ $1 =~ ^[0-9].[0-9].[0-9]$ ]]; then | |
get_diff $1 | |
else | |
echo "empty or invalid tag" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment