Skip to content

Commit

Permalink
Update changelog script to sort versions properly
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed May 11, 2018
1 parent 8067d07 commit 11b4ff6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/changelog
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash -eu
versions() {
git tag | grep '^v'
git tag | grep '^v' | sort --field-separator=. --key=1,1nr --key=2,2nr --key=3,3nr
}

if [[ $# > 0 ]]; then
current="$1"
else
current="$(versions | tail -n1)"
current="$(versions | head -n1)"
fi
if [[ $# > 1 ]]; then
previous="$2"
else
previous="$(versions | tail -n2 | head -n1)"
previous="$(versions | head -n2 | tail -n1)"
fi

echo "Changelog $previous -> $current"
Expand Down

0 comments on commit 11b4ff6

Please sign in to comment.