Skip to content

Commit abc6d72

Browse files
author
José Valim
committed
Stop apps in reverse load order
1 parent 1af347d commit abc6d72

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/iex/lib/iex/helpers.ex

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ defmodule IEx.Helpers do
5151
To learn more about IEx as a whole, just type `h(IEx)`.
5252
"""
5353

54-
require Logger
5554
import IEx, only: [dont_display_result: 0]
5655

5756
@doc """
@@ -79,11 +78,12 @@ defmodule IEx.Helpers do
7978
if mix_started? do
8079
config = Mix.Project.config
8180
reenable_tasks(config)
82-
stop_apps(config)
81+
apps = stop_apps(config)
8382
Mix.Task.run("app.start")
83+
{:restarted, apps}
8484
else
8585
IO.puts IEx.color(:eval_error, "Mix is not running. Please start IEx with: iex -S mix")
86-
dont_display_result
86+
:error
8787
end
8888
end
8989

@@ -109,7 +109,8 @@ defmodule IEx.Helpers do
109109
true ->
110110
[]
111111
end
112-
Enum.each apps, &Application.stop/1
112+
apps |> Enum.reverse |> Enum.each(&Application.stop/1)
113+
apps
113114
end
114115

115116
@doc """

0 commit comments

Comments
 (0)