Skip to content

Commit

Permalink
improvement: print version diff when upgrading packages (#185)
Browse files Browse the repository at this point in the history
* improvement: sort the `missing` packages when upgrading

Signed-off-by: Adam Tharani <adamtharani@me.com>

---------

Signed-off-by: Adam Tharani <adamtharani@me.com>
  • Loading branch information
adamtharani authored Jan 3, 2025
1 parent 20915cb commit c539fad
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions lib/mix/tasks/igniter.upgrade.ex
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,22 @@ defmodule Mix.Tasks.Igniter.Upgrade do
igniter

{igniter, missing} ->
Igniter.add_notice(
igniter,
"The packages `#{Enum.join(missing, ", ")}` did not have upgrade tasks."
)
missing =
missing
|> Enum.sort()
|> Enum.join(", ")

upgrades =
dep_changes
|> Enum.sort()
|> Enum.map_join("\n", fn {app, from, to} ->
"#{app} #{from} => #{to}"
end)
|> String.trim_trailing("\n")

igniter
|> Igniter.add_notice("The packages `#{missing}` did not have upgrade tasks.")
|> Igniter.add_notice("Upgraded packages:\n#{upgrades}")
end
rescue
e ->
Expand Down

0 comments on commit c539fad

Please sign in to comment.