I had a config/runtime.exs.
import Config
config :test,
port: 1333
And the application.
def start(_type, _args) do
Supervisor.start_link([], strategy: :one_for_one)
end
Mix task.
defmodule Mix.Tasks.Example do
use Mix.Task
def run(_args) do
IO.inspect(Application.get_env(:test, :port))
end
end
But when I hit my mix tasks mix something
, it returns nil
.
The interesting thing is if I run it on interactive mode (iex -S mix), the application env can retrieval normally.
What I could miss here, in order to get runtime config on mix task?