Skip to content

Commit ab61e15

Browse files
committed
docs: fix bump-release
- Restore "Unreleased" section in CHANGELOG. - Try to inform the user what the mandatory argument represents.
1 parent 39d4456 commit ab61e15

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bump-release

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,23 @@ bump()
1010
sed -i '/^version /c version = "'"$v"'"' Cargo.toml
1111
sed -i "/^:version: /c :version: $v" doc/*.adoc
1212
cargo build
13-
git add --patch
1413
}
1514

1615
main()
1716
{
18-
local v="$1"
17+
local v="${1:?specify version}"
1918

2019
sed -i 's/Unreleased/'"$v - $(date --iso-8601=date)"'/' CHANGELOG.md
2120
bump "$v"
21+
git add --patch
2222
git commit --message "commitmsgfmt $v"
2323
git tag --annotate "v$v" --message "commitmsgfmt $v"
2424

2525
bump "$v-GIT"
26+
local f=$(mktemp)
27+
awk '/^## / && !done { print "## Unreleased\n" ; done=1 } 1' CHANGELOG.md > $f
28+
mv $f CHANGELOG.md
29+
git add --patch
2630
git commit --message "Start next cycle"
2731
}
2832

0 commit comments

Comments
 (0)