mirror of https://github.com/jenv/jenv.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
671 B
35 lines
671 B
#!/usr/bin/env bash |
|
|
|
FROM_VERSION=0.5.0 |
|
CHANGELOG_FILE=CHANGELOG.md |
|
|
|
changelog() { |
|
local opts=$@ |
|
|
|
if ! type -t git-cliff &>/dev/null |
|
then |
|
echo "git-cliff is required to generate the changelog" >&2 |
|
return 1 |
|
fi |
|
|
|
if [ -z "$opts" ] |
|
then |
|
echo "Using default opt --bump" |
|
opts="--bump" |
|
fi |
|
|
|
local changelog_details |
|
changelog_details=$(git-cliff $opts "$FROM_VERSION..") |
|
|
|
if [ -z "$changelog_details" ] |
|
then |
|
echo "Changelog generation failed" >&2 |
|
return 2 |
|
fi |
|
|
|
echo "$changelog_details" | uniq > "$CHANGELOG_FILE" |
|
|
|
echo "Changelog written to $CHANGELOG_FILE" |
|
} |
|
|
|
changelog "$@"
|
|
|