Skip to content

Commit

Permalink
improvement: add tracking multiple "readme" file for versions
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Apr 4, 2022
1 parent 1e12ef5 commit 0b47c79
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"workbench.colorCustomizations": {
"activityBar.background": "#5C043C",
"titleBar.activeBackground": "#810654",
"titleBar.activeForeground": "#FFFBFD"
}
}
16 changes: 12 additions & 4 deletions lib/mix/tasks/git_ops.release.ex
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,27 @@ defmodule Mix.Tasks.GitOps.Release do
end

readme_changes =
if readme do
VersionReplace.update_readme(readme, current_version, new_version, opts)
end
readme
|> List.wrap()
|> Enum.map(fn readme ->
{readme, VersionReplace.update_readme(readme, current_version, new_version, opts)}
end)

if opts[:dry_run] do
"Below are the contents of files that will change.\n"
|> append_changes_to_message(changelog_file, changelog_changes)
|> append_changes_to_message(readme, readme_changes)
|> add_readme_changes(readme_changes)
|> append_changes_to_message(mix_project_module, mix_project_changes)
|> Mix.shell().info()
end
end

defp add_readme_changes(message, readme_changes) do
Enum.reduce(readme_changes, message, fn {file, changes}, message ->
append_changes_to_message(message, file, changes)
end)
end

defp tag(repo, changelog_file, new_version, new_message) do
Git.add!(repo, "#{changelog_file}")
Git.commit!(repo, ["-am", "chore: release version #{new_version}"])
Expand Down

0 comments on commit 0b47c79

Please sign in to comment.