Skip to content

Commit 4828f11

Browse files
committed
Keep invoking loadconfig on cli boot
1 parent 501271c commit 4828f11

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/mix/lib/mix/cli.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ defmodule Mix.CLI do
7878
defp run_task(name, args) do
7979
try do
8080
ensure_no_slashes(name)
81-
Mix.Tasks.Loadconfig.load_default()
81+
# We must go through the task instead of invoking the module directly
82+
# because projects like Nerves use this to invoke it early.
83+
Mix.Task.run("loadconfig")
8284
Mix.Task.run(name, args)
8385
rescue
8486
# We only rescue exceptions in the Mix namespace, all

lib/mix/lib/mix/tasks/loadconfig.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ defmodule Mix.Tasks.Loadconfig do
3333
end
3434
end
3535

36-
@doc false
37-
def load_default do
36+
defp load_default do
3837
config = Mix.Project.config()
3938

4039
if File.regular?(config[:config_path]) or config[:config_path] != "config/config.exs" do

0 commit comments

Comments
 (0)