Skip to content

Instantly share code, notes, and snippets.

@sphrak
Last active March 5, 2020 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sphrak/585ff91e77088d0877dd5869c3c2c0da to your computer and use it in GitHub Desktop.
Save sphrak/585ff91e77088d0877dd5869c3c2c0da to your computer and use it in GitHub Desktop.
a tiny script for outputting changelog diff between releases for (semver)
#!/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