Skip to content

Commit beb1bbe

Browse files
author
José Valim
committed
Ensure config/config.exs is really persisted
1 parent cc9783a commit beb1bbe

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/elixir/lib/uri.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ defmodule URI do
5858
"""
5959
def default_port(scheme, port) when is_binary(scheme) and port > 0 do
6060
{:ok, dict} = Application.fetch_env(:elixir, :uri)
61-
Application.put_env(:elixir, :uri, Map.put(dict, scheme, port), persist: true)
61+
Application.put_env(:elixir, :uri, Map.put(dict, scheme, port), persistent: true)
6262
end
6363

6464
@doc """

lib/mix/lib/mix/config.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ defmodule Mix.Config do
2121
"""
2222
def persist(config) do
2323
for {app, kw} <- config, {k, v} <- kw do
24-
:application.set_env(app, k, v, persist: true)
24+
:application.set_env(app, k, v, persistent: true)
2525
end
2626
:ok
2727
end

lib/mix/test/mix/tasks/loadconfig_test.exs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ defmodule Mix.Tasks.LoadconfigTest do
88
teardown do
99
Enum.each @apps, fn app ->
1010
Enum.each Application.get_all_env(app), fn {key, _} ->
11-
Application.delete_env(app, key, persist: true)
11+
Application.delete_env(app, key, persistent: true)
1212
end
1313
end
1414
:ok
@@ -31,6 +31,8 @@ defmodule Mix.Tasks.LoadconfigTest do
3131
assert Application.fetch_env(:my_app, :key) == :error
3232
Mix.Tasks.Loadconfig.run []
3333
assert Application.fetch_env(:my_app, :key) == {:ok, :value}
34+
:ok = :application.load({:application, :my_app, [vsn: '1.0.0', env: [key: :app]]})
35+
assert Application.fetch_env(:my_app, :key) == {:ok, :value}
3436
end
3537
end
3638

0 commit comments

Comments
 (0)