lib/mix/tasks/ca.config.distillery.ex

defmodule Mix.Tasks.Ca.Config.Distillery do
  @moduledoc """
  Creates distillery configuration for the clean architecture project
      $ mix ca.config.distillery
  """

  alias ScaffoldCa.Utils.CommonCommands
  alias ScaffoldCa.Core.ApplyTemplate
  alias Mix.Tasks.Ca.BaseTask

  use BaseTask,
    name: "ca.config.distillery",
    description: "Creates distillery configuration"

  def execute({[], []}) do
    ApplyTemplate.apply(:distillery, "non_required")
    CommonCommands.install_deps()
    CommonCommands.distillery_init()
  end

  def execute(_any), do: run(["-h"])
end