I am creating a CLI app, which I intend to release as a binary using the great Bakeware
project.
I am able to successfully create a binary and everything with the executable works great.
The binary is not practical for testing and development. I have created a Mix task to help in that regard:
defmodule Mix.Tasks.MyCLI do
use Mix.Task
def run(args) do
Mix.Task.run("app.start")
MyCLI.main(args)
end
end
Due to the requirements of Bakeware
, I also have that module set up as the mod
under application
in my mix.exs
:
def application do
[
extra_applications: [:logger],
mod: {MyCLI, []}
]
end
When I run the CLI using my Mix Task, it seems to start two versions of the application at the same time. This does not happen via the executable.
What is the right way to set up my project for both development and release?