Skip to content

Commit 8bfe324

Browse files
author
José Valim
committed
Allow mix/apps configuration via ~/.mix/config.exs
1 parent 8010e44 commit 8bfe324

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/mix/lib/mix/cli.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ defmodule Mix.CLI do
2020

2121
defp proceed(args) do
2222
Mix.Tasks.Local.Hex.maybe_update()
23+
load_dot_config()
2324
args = load_mixfile(args)
2425
{task, args} = get_task(args)
2526
change_env(task)
@@ -98,6 +99,15 @@ defmodule Mix.CLI do
9899
end
99100
end
100101

102+
defp load_dot_config do
103+
path = Path.expand("~/.mix/config.exs")
104+
if File.regular?(path) do
105+
path
106+
|> Mix.Config.read()
107+
|> Mix.Tasks.Loadconfig.set()
108+
end
109+
end
110+
101111
defp display_version() do
102112
IO.puts "Elixir #{System.version}"
103113
end

0 commit comments

Comments
 (0)