Skip to content

Commit f61abff

Browse files
author
José Valim
committed
Allow mix cmd to be invoked multiple times, closes #7049
1 parent 9a52f2a commit f61abff

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/mix/lib/mix/tasks/cmd.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ defmodule Mix.Tasks.Cmd do
2929
status -> exit(status)
3030
end
3131
end
32+
33+
Mix.Task.reenable("cmd")
3234
end
3335

3436
defp parse_apps(args, apps) do

lib/mix/test/mix/tasks/cmd_test.exs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ Code.require_file("../../test_helper.exs", __DIR__)
33
defmodule Mix.Tasks.CmdTest do
44
use MixTest.Case
55

6+
test "can be called multiple times" do
7+
nl = os_newline()
8+
Mix.Task.run("cmd", ["echo", "hello"])
9+
assert_received {:mix_shell, :run, ["hello" <> ^nl]}
10+
Mix.Task.run("cmd", ["echo", "hello"])
11+
assert_received {:mix_shell, :run, ["hello" <> ^nl]}
12+
end
13+
614
test "runs the command for each app" do
715
in_fixture "umbrella_dep/deps/umbrella", fn ->
816
Mix.Project.in_project(:umbrella, ".", fn _ ->

0 commit comments

Comments
 (0)