Skip to content

Commit a33d911

Browse files
princemapleJosé Valim
authored andcommitted
Expand paths so mix format path\for\windows.ex works (#8147)
1 parent 7d744eb commit a33d911

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/mix/lib/mix/tasks/format.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ defmodule Mix.Tasks.Format do
382382
end
383383

384384
defp stdin_or_wildcard("-"), do: [:stdin]
385-
defp stdin_or_wildcard(path), do: Path.wildcard(path, match_dot: true)
385+
defp stdin_or_wildcard(path), do: path |> Path.expand() |> Path.wildcard(match_dot: true)
386386

387387
defp read_file(:stdin) do
388388
{IO.stream(:stdio, :line) |> Enum.to_list() |> IO.iodata_to_binary(), file: "stdin"}
@@ -447,7 +447,7 @@ defmodule Mix.Tasks.Format do
447447
end
448448

449449
defp check!({[{:exit, file, exception, stacktrace} | _], _not_equivalent, _not_formatted}) do
450-
Mix.shell().error("mix format failed for file: #{file}")
450+
Mix.shell().error("mix format failed for file: #{Path.relative_to_cwd(file)}")
451451
reraise exception, stacktrace
452452
end
453453

0 commit comments

Comments
 (0)