Skip to content

Commit 4a5fb1e

Browse files
committed
Use binwrite only on Windows, closes #14101
1 parent 0fe6f68 commit 4a5fb1e

File tree

1 file changed

+3
-3
lines changed
  • lib/mix/lib/mix/shell

1 file changed

+3
-3
lines changed

lib/mix/lib/mix/shell/io.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ defmodule Mix.Shell.IO do
100100
"""
101101
def cmd(command, opts \\ []) do
102102
print_app? = Keyword.get(opts, :print_app, true)
103+
windows? = match?({:win32, _}, :os.type())
103104

104105
Mix.Shell.cmd(command, opts, fn data ->
105106
if print_app?, do: print_app()
106-
# Due to encoding of shell command on Windows,
107-
# let's write the data as is
108-
IO.binwrite(data)
107+
# Due to encoding of shell command on Windows, write the data as is.
108+
if windows?, do: IO.binwrite(data), else: IO.write(data)
109109
end)
110110
end
111111
end

0 commit comments

Comments
 (0)