Skip to content

Commit cb81c6b

Browse files
committed
Start app after changing System.argv on 'mix run'
1 parent 2cc4fd2 commit cb81c6b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/mix/lib/mix/tasks/run.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@ defmodule Mix.Tasks.Run do
3939
# Require the project to be available
4040
Mix.Project.get!
4141

42-
Mix.Task.run "app.start", args
43-
4442
file =
4543
case head do
4644
["--"|t] -> System.argv(t); nil
4745
[h|t] -> System.argv(t); h
4846
[] -> System.argv([]); nil
4947
end
5048

49+
# Start app after rewriting System.argv,
50+
# but before requiring and evaling
51+
Mix.Task.run "app.start", args
52+
5153
Enum.each opts, fn({ key, value }) ->
5254
case key do
5355
:parallel_require ->

0 commit comments

Comments
 (0)