Skip to content

Instantly share code, notes, and snippets.

@macro6461
Created April 13, 2022 18:04
Show Gist options
  • Save macro6461/2d6f8e7f536efb5e2abfdb8c89d4e47c to your computer and use it in GitHub Desktop.
Save macro6461/2d6f8e7f536efb5e2abfdb8c89d4e47c to your computer and use it in GitHub Desktop.
This is the gist for `new_changelog_item` bash script
new_changelog_item()
{
while read line; do
if [[ $line == "## [Unreleased]"* ]]; then
newvar=$(<<<"$line" sed 's/[].*[]/\\&/g')
echo $newvar
echo "LINE FOUND IN" CHANGELOG.md
sed -i "" "s/$newvar/## [Unreleased]\n\n## [$version] - $date\n### Added\n - ADD CHANGE HERE!/" CHANGELOG.md
return
fi
done < CHANGELOG.md
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment