defmodule Mix.Tasks.AshStateMachine.Install.Docs do @moduledoc false def short_doc do "Installs AshStateMachine" end def example do "mix igniter.install ash_state_machine" end def long_doc do """ #{short_doc()} ## Example ```bash #{example()} ``` """ end end if Code.ensure_loaded?(Igniter) do defmodule Mix.Tasks.AshStateMachine.Install do @shortdoc "#{__MODULE__.Docs.short_doc()}" @moduledoc __MODULE__.Docs.long_doc() use Igniter.Mix.Task @impl Igniter.Mix.Task def info(_argv, _composing_task) do %Igniter.Mix.Task.Info{ # Groups allow for overlapping arguments for tasks by the same author # See the generators guide for more. group: :ash, # *other* dependencies to add and call their associated installers, if they exist # i.e `{:foo, "~> 2.0"}` installs: [{:ash, "~> 3.0"}], # An example invocation example: __MODULE__.Docs.example() } end @impl Igniter.Mix.Task def igniter(igniter) do igniter |> Igniter.Project.Formatter.import_dep(:ash_state_machine) end end else defmodule Mix.Tasks.AshStateMachine.Install do @shortdoc "#{__MODULE__.Docs.short_doc()} | Install `igniter` to use" @moduledoc __MODULE__.Docs.long_doc() use Mix.Task def run(_argv) do Mix.shell().error(""" The task 'ash_state_machine.install' requires igniter. Please install igniter and try again. For more information, see: https://hexdocs.pm/igniter/readme.html#installation """) exit({:shutdown, 1}) end end end