Skip to content

Commit a75e70b

Browse files
author
José Valim
committed
Avoid interpolation which would convert char lists twice
1 parent aba0d5b commit a75e70b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/mix/lib/mix/shell.ex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ defmodule Mix.Shell do
6060
{ :unix, _ } ->
6161
command = command
6262
|> String.replace("\"", "\\\"")
63-
|> :binary.bin_to_list # We need to send bytes, not chars
64-
%c(sh -c "#{command}")
63+
|> :binary.bin_to_list
64+
'sh -c ' ++ command
6565

6666
{ :win32, osname } ->
67-
command = to_char_list(command)
67+
command = :binary.bin_to_list(command)
6868
case { System.get_env("COMSPEC"), osname } do
69-
{ nil, :windows } -> 'command.com /c #{command}'
70-
{ nil, _ } -> 'cmd /c #{command}'
71-
{ cmd, _ } -> '#{cmd} /c #{command}'
69+
{ nil, :windows } -> 'command.com /c ' ++ command
70+
{ nil, _ } -> 'cmd /c ' ++ command
71+
{ cmd, _ } -> '#{cmd} /c ' ++ command
7272
end
7373
end
7474
end

0 commit comments

Comments
 (0)