Skip to content

Commit

Permalink
"clauses with the same name should be grouped together"
Browse files Browse the repository at this point in the history
  • Loading branch information
krainboltgreene authored and cpjolicoeur committed Jan 3, 2022
1 parent 664b14d commit 8303f92
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/mix/torch.ex
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ defmodule Mix.Torch do
inject_templates("phx.gen.html", slime_or_eex, "eex")
end

def inject_templates("phx.gen.context", _) do
copy_from("priv/templates/phx.gen.context", [
{"access_no_schema.ex", "priv/templates/phx.gen.context/access_no_schema.ex"},
{"context.ex", "priv/templates/phx.gen.context/context.ex"},
{"schema_access.ex", "priv/templates/phx.gen.context/schema_access.ex"},
{"test_cases.exs", "priv/templates/phx.gen.context/test_cases.exs"},
{"context_test.exs", "priv/templates/phx.gen.context/context_test.exs"}
])
end

def inject_templates("phx.gen.html", format, dest_format) do
copy_from("priv/templates/#{format}/phx.gen.html", [
{"edit.html.#{format}", "priv/templates/phx.gen.html/edit.html.#{dest_format}"},
Expand All @@ -98,16 +108,6 @@ defmodule Mix.Torch do
])
end

def inject_templates("phx.gen.context", _format) do
copy_from("priv/templates/phx.gen.context", [
{"access_no_schema.ex", "priv/templates/phx.gen.context/access_no_schema.ex"},
{"context.ex", "priv/templates/phx.gen.context/context.ex"},
{"schema_access.ex", "priv/templates/phx.gen.context/schema_access.ex"},
{"test_cases.exs", "priv/templates/phx.gen.context/test_cases.exs"},
{"context_test.exs", "priv/templates/phx.gen.context/context_test.exs"}
])
end

def backup_project_templates(mix_task_name) do
File.rename("priv/templates/#{mix_task_name}", "priv/templates/#{mix_task_name}_backup")
end
Expand Down

0 comments on commit 8303f92

Please sign in to comment.