Skip to content

Commit

Permalink
Use Mix.Phoenix.generator_paths in phx.gen.auth.ex (#5851)
Browse files Browse the repository at this point in the history
Replace the local private function with the public one in Mix.Phoenix used by all the other generators.
  • Loading branch information
Zurga committed Jun 20, 2024
1 parent e99f657 commit 6b7b78a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/mix/tasks/phx.gen.auth.ex
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ defmodule Mix.Tasks.Phx.Gen.Auth do
live?: Keyword.fetch!(context.opts, :live)
]

paths = generator_paths()
paths = Mix.Phoenix.generator_paths()

prompt_for_conflicts(context)

Expand Down Expand Up @@ -716,14 +716,6 @@ defmodule Mix.Tasks.Phx.Gen.Auth do
defp web_path_prefix(%Schema{web_path: nil}), do: ""
defp web_path_prefix(%Schema{web_path: web_path}), do: "/" <> web_path

# The paths to look for template files for generators.
#
# Defaults to checking the current app's `priv` directory,
# and falls back to phx_gen_auth's `priv` directory.
defp generator_paths do
[".", :phoenix]
end

defp inject_before_final_end(content_to_inject, file_path) do
with {:ok, file} <- read_file(file_path),
{:ok, new_file} <- Injector.inject_before_final_end(file, content_to_inject) do
Expand Down

0 comments on commit 6b7b78a

Please sign in to comment.