 
   def copy_from(%Project{} = project, mod, name) when is_atom(name) do
     mapping = mod.template_files(name)
+
     for {format, source, project_location, target_path} <- mapping do
       target = Project.join_path(project, project_location, target_path)
 
       case format do
         :keep ->
           File.mkdir_p!(target)
+
         :text ->
           create_file(target, mod.render(name, source, project.binding))
+
         :config ->
           contents = mod.render(name, source, project.binding)
           config_inject(Path.dirname(target), Path.basename(target), contents)
+
         :prod_config ->
           contents = mod.render(name, source, project.binding)
           prod_only_config_inject(Path.dirname(target), Path.basename(target), contents)
-        :eex  ->
+
+        :eex ->
           contents = mod.render(name, source, project.binding)
           create_file(target, contents)
       end

  end

  def put_binding(%Project{opts: opts} = project) do
    db           = Keyword.get(opts, :database, "postgres")
    ecto         = Keyword.get(opts, :ecto, true)
    html         = Keyword.get(opts, :html, true)
    live         = Keyword.get(opts, :live, false)
    dashboard    = Keyword.get(opts, :dashboard, true)
    gettext      = Keyword.get(opts, :gettext, true)
    webpack      = Keyword.get(opts, :webpack, true)
    dev          = Keyword.get(opts, :dev, false)
    phoenix_path = phoenix_path(project, dev)

    # We lowercase the database name because according to the

    |> Enum.map(fn _ -> ".." end)
    |> Path.join()
  end

  defp phoenix_path(%Project{}, false) do
    "deps/phoenix"
  end

  defp phoenix_path_prefix(%Project{in_umbrella?: true}), do: "../../../"
  defp phoenix_path_prefix(%Project{in_umbrella?: false}), do: ".."

  defp phoenix_webpack_path(%Project{in_umbrella?: true}, true = _dev),
    do: "../../../../../"

  defp phoenix_webpack_path(%Project{in_umbrella?: true}, false = _dev),
    do: "../../../deps/phoenix"

  defp phoenix_webpack_path(%Project{in_umbrella?: false}, true = _dev),
    do: "../../../"

  defp phoenix_webpack_path(%Project{in_umbrella?: false}, false = _dev),
    do: "../deps/phoenix"

  defp phoenix_html_webpack_path(%Project{in_umbrella?: true}),
    do: "../../../deps/phoenix_html"

  defp phoenix_html_webpack_path(%Project{in_umbrella?: false}),
    do: "../deps/phoenix_html"

  defp phoenix_live_view_webpack_path(%Project{in_umbrella?: true}),
    do: "../../../deps/phoenix_live_view"

  defp phoenix_live_view_webpack_path(%Project{in_umbrella?: false}),
    do: "../deps/phoenix_live_view"

  defp phoenix_dep("deps/phoenix"), do: ~s[{:phoenix, "~> #{@phoenix_version}"}]

  # defp phoenix_dep("deps/phoenix"), do: ~s[{:phoenix, github: "phoenixframework/phoenix", override: true}]
  defp phoenix_dep(path), do: ~s[{:phoenix, path: #{inspect(path)}, override: true}]

  defp phoenix_static_path("deps/phoenix"), do: "deps/phoenix"
  defp phoenix_static_path(path), do: Path.join("..", path)

  defp random_string(length) do
    :crypto.strong_rand_bytes(length) |> Base.encode64() |> binary_part(0, length)
  end
end
