Skip to content

Commit 740b2d7

Browse files
committed
Escape rebar3 paths
1 parent da0189e commit 740b2d7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/mix/lib/mix/tasks/deps.compile.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ defmodule Mix.Tasks.Deps.Compile do
207207
{"TERM", "dumb"}
208208
]
209209

210-
cmd = "#{rebar_cmd(dep)} bare compile --paths #{lib_path}"
210+
cmd = "#{escape_path(rebar_cmd(dep))} bare compile --paths #{escape_path(lib_path)}"
211211
do_command(dep, config, cmd, false, env)
212212

213213
# Check if we have any new symlinks after compilation
@@ -220,6 +220,11 @@ defmodule Mix.Tasks.Deps.Compile do
220220
true
221221
end
222222

223+
defp escape_path(path) do
224+
escape = if match?({:win32, _}, :os.type()), do: "^ ", else: "\\ "
225+
String.replace(path, " ", escape)
226+
end
227+
223228
defp rebar_config(dep) do
224229
dep.extra
225230
|> Mix.Rebar.dependency_config()

0 commit comments

Comments
 (0)