Skip to content

Instantly share code, notes, and snippets.

@sphrak

sphrak/semverdiff.sh

Last active Mar 5, 2020
Embed
What would you like to do?
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