Skip to content

Commit 0a677fe

Browse files
author
José Valim
committed
Properly advertise the --no-mix-exs flag
1 parent 5b25761 commit 0a677fe

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

lib/mix/lib/mix/tasks/profile.cprof.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ defmodule Mix.Tasks.Profile.Cprof do
9999
{opts, head} = OptionParser.parse_head!(args,
100100
aliases: [r: :require, p: :parallel, e: :eval, c: :config],
101101
strict: @switches)
102-
Mix.Tasks.Run.run(["--no-mixexs" | args], opts, head,
102+
Mix.Tasks.Run.run(["--no-mix-exs" | args], opts, head,
103103
&profile_code(&1, opts),
104104
&profile_code(File.read!(&1), opts))
105105
end

lib/mix/lib/mix/tasks/profile.fprof.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ defmodule Mix.Tasks.Profile.Fprof do
116116
{opts, head} = OptionParser.parse_head!(args,
117117
aliases: [r: :require, p: :parallel, e: :eval, c: :config],
118118
strict: @switches)
119-
Mix.Tasks.Run.run(["--no-mixexs" | args], opts, head,
119+
Mix.Tasks.Run.run(["--no-mix-exs" | args], opts, head,
120120
&profile_code(&1, opts),
121121
&profile_code(File.read!(&1), opts))
122122
end

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ defmodule Mix.Tasks.Run do
3838
* `--no-deps-check` - does not check dependencies
3939
* `--no-archives-check` - does not check archives
4040
* `--no-halt` - does not halt the system after running the command
41-
* `--no-mixexs` - allows the command to run even if there is no mix.exs
41+
* `--no-mix-exs` - allows the command to run even if there is no mix.exs
4242
* `--no-start` - does not start applications after compilation
4343
* `--no-elixir-version-check` - does not check the Elixir version from mix.exs
4444
@@ -87,10 +87,12 @@ defmodule Mix.Tasks.Run do
8787
cond do
8888
Mix.Project.get ->
8989
Mix.Task.run "app.start", args
90-
"--no-mixexs" in args ->
90+
"--no-mix-exs" in args ->
9191
:ok
9292
true ->
93-
Mix.Project.get!
93+
Mix.raise "Cannot execute \"mix run\" without a Mix.Project, " <>
94+
"please ensure you are running Mix in a directory with a mix.exs file " <>
95+
"or pass the --no-mix-exs flag"
9496
end
9597

9698
process_load(opts, expr_evaluator)

0 commit comments

Comments
 (0)