defmodule <%= @app_module %>.Application do @moduledoc """ Burrito-friendly entry point for `<%= @app %>`. Burrito's `main_module` config is metadata only -- it does NOT call any `main/1` function. The real entry point for a wrapped binary is this OTP application callback. Without it the binary boots the BEAM and then sits there waiting on the runtime forever. Generated by `mix tinfoil.init --install`. Edit as needed. """ use Application @impl true def start(_type, _args) do # Only dispatch the CLI when we're actually a Burrito-wrapped # binary. In `mix test` / `iex -S mix` this callback also fires # and `System.argv()` would be the tool's own args. if Burrito.Util.running_standalone?() do spawn(fn -> argv = Burrito.Util.Args.argv() <%= @app_module %>.CLI.run(argv) System.halt(0) end) end Supervisor.start_link([], strategy: :one_for_one, name: <%= @app_module %>.Supervisor) end end