Updating changelog when building releases#192
Conversation
avishalom
left a comment
There was a problem hiding this comment.
LGTM, if you like I suggested a change to make the sed -ing more robust
createReleaseTarball.sh
Outdated
| # UPDATE CHANGELOG.md # | ||
| ######################### | ||
| echo "[INFO] Updating version number in CHANGELOG.md to ${VERSION_WITHOUT_RC}..." | ||
| sed -i '' -e s/"# Unreleased"/"# v${VERSION_WITHOUT_RC}"/ CHANGELOG.md |
There was a problem hiding this comment.
This seems a bit fragile, What if "# Unreleased" appears anywhere else.
Also, it seems that the current version doesn't have a blank line in line number 2 .
What if it was deleted in the process.
I suggest,
- only sed-ing the first line,
- replace "# Unreleased" or ignore it and append if it isn't there
- append to the end of the first line so that anything non congruent stands out
s.t. like
sed -i '' -E '1 s/(# Unreleased|^)/# Unreleased'$'\\n\\n-\\n'"# v${VERSION_WITHOUT_RC}/" CHANGELOG.md
instead of lines 95-97
There was a problem hiding this comment.
Updated the sed command to only replace the first occurrence. Points 2 and 3 are hard to implement in a way that is compatible with both Linux and Mac. So I'm keeping the simple cat to file, and move solution for now.
There was a problem hiding this comment.
My only worry is that if someone accidentally changes that first line, the version will not be added.
How about replacing the first "# Unreleased" with nothing ("") and adding the v$VERSION_WITHOUT_RC in the echo in the next line ?
No description provided.