Skip to content

Commit

Permalink
match on version struct
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenDE committed Jan 26, 2025
1 parent ea8fa5f commit cc1223b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion installer/lib/mix/tasks/phx.new.ex
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,12 @@ defmodule Mix.Tasks.Phx.New do

if version_task do
try do
latest_version = Task.await(version_task, 3_000)
# if we get anything else than a `Version`, we'll get a MatchError
# and fail silently
%Version{} = latest_version = Task.await(version_task, 3_000)
maybe_warn_outdated(latest_version)
rescue
_ -> :ok
catch
:exit, _ -> :ok
end
Expand Down

0 comments on commit cc1223b

Please sign in to comment.