Skip to content

Commit 539dab6

Browse files
committed
Be consistent in error messages
1 parent 58fe5b7 commit 539dab6

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

lib/elixir_make/compiler.ex

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,16 @@ defmodule ElixirMake.Compiler do
7474
env = if is_function(env), do: env.(), else: env
7575
env = default_env(config, env)
7676

77-
# In OTP 19, Erlang's `open_port/2` ignores the current working
78-
# directory when expanding relative paths. This means that `:make_cwd`
79-
# must be an absolute path. This is a different behaviour from earlier
80-
# OTP versions and appears to be a bug. It is being tracked at
81-
# https://bugs.erlang.org/browse/ERL-175.
8277
cwd = Keyword.get(config, :make_cwd, ".") |> Path.expand(File.cwd!())
8378
error_msg = Keyword.get(config, :make_error_message, :default) |> os_specific_error_msg()
8479
custom_args = Keyword.get(config, :make_args, [])
8580

8681
if String.contains?(cwd, " ") do
87-
IO.warn(
88-
"the absolute path to the makefile for this project contains spaces. Make might " <>
89-
"not work properly if spaces are present in the path. The absolute path is: " <>
90-
inspect(cwd)
91-
)
82+
IO.warn("""
83+
the absolute path to the Makefile for this project contains spaces. \
84+
Make might not work properly if spaces are present in the path. \
85+
The absolute path is: #{inspect(cwd)}
86+
""")
9287
end
9388

9489
base = exec |> Path.basename() |> Path.rootname()
@@ -124,7 +119,7 @@ defmodule ElixirMake.Compiler do
124119
defp find_executable(exec) do
125120
System.find_executable(exec) ||
126121
Mix.raise("""
127-
"#{exec}" not found in the path. If you have set the MAKE environment variable,
122+
"#{exec}" not found in the path. If you have set the MAKE environment variable, \
128123
please make sure it is correct.
129124
""")
130125
end

test/mix/tasks/compile.make_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ defmodule Mix.Tasks.Compile.ElixirMakeTest do
109109
capture_io(:stdio, fn ->
110110
with_project_config([make_cwd: "subdir with spaces"], fn ->
111111
assert capture_io(:stderr, fn -> run([]) end) =~
112-
"the absolute path to the makefile for this project contains spaces."
112+
"the absolute path to the Makefile for this project contains spaces."
113113
end)
114114
end)
115115
end)

0 commit comments

Comments
 (0)