Skip to content

Commit 95dcbe9

Browse files
wojtekmachjosevalim
authored andcommitted
Mix.install/2: Expand paths for path deps (#11012)
1 parent 98a79dc commit 95dcbe9

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

lib/mix/lib/mix.ex

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,17 @@ defmodule Mix do
518518

519519
deps =
520520
Enum.map(deps, fn
521-
dep when is_atom(dep) -> {dep, ">= 0.0.0"}
522-
dep -> dep
521+
dep when is_atom(dep) ->
522+
{dep, ">= 0.0.0"}
523+
524+
{app, opts} when is_atom(app) and is_list(opts) ->
525+
{app, maybe_expand_path_dep(opts)}
526+
527+
{app, requirement, opts} when is_atom(app) and is_binary(requirement) and is_list(opts) ->
528+
{app, requirement, maybe_expand_path_dep(opts)}
529+
530+
other ->
531+
other
523532
end)
524533

525534
force? = !!opts[:force]
@@ -590,4 +599,12 @@ defmodule Mix do
590599
Mix.ProjectStack.pop()
591600
end
592601
end
602+
603+
defp maybe_expand_path_dep(opts) do
604+
if Keyword.has_key?(opts, :path) do
605+
Keyword.update!(opts, :path, &Path.expand/1)
606+
else
607+
opts
608+
end
609+
end
593610
end

0 commit comments

Comments
 (0)