Skip to content

Commit e88a1b6

Browse files
author
José Valim
committed
Ensure stacktraces are shown on app_path failures
Signed-off-by: José Valim <[email protected]>
1 parent 2e4c7ab commit e88a1b6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/mix/lib/mix/project.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ defmodule Mix.Project do
282282
app = config[:app] ->
283283
Path.join([build_path(config), "lib", Atom.to_string(app)])
284284
config[:apps_path] ->
285-
Mix.raise "Trying to access app_path for an umbrella project but umbrellas have no app"
285+
raise "Trying to access app_path for an umbrella project but umbrellas have no app"
286286
true ->
287287
Mix.raise "Cannot access build without an application name, " <>
288288
"please ensure you are in a directory with a mix.exs file and it defines " <>
@@ -314,7 +314,9 @@ defmodule Mix.Project do
314314
"""
315315
def compile(args, config \\ config()) do
316316
if config[:build_embedded] do
317-
if not File.exists?(compile_path(config)) do
317+
path = if umbrella?(config), do: build_path(config), else: compile_path(config)
318+
319+
unless File.exists?(path) do
318320
Mix.raise "Cannot execute task because the project was not yet compiled. " <>
319321
"When build_embedded is set to true, \"MIX_ENV=#{Mix.env} mix compile\" " <>
320322
"must be explicitly executed"

lib/mix/lib/mix/tasks/app.start.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
defmodule Mix.Tasks.App.Start do
22
use Mix.Task
33

4+
# Do not mark this task as recursive as it is
5+
# responsible for loading consolidated protocols.
46
@shortdoc "Starts all registered apps"
57

68
@moduledoc """

0 commit comments

Comments
 (0)