Skip to content

Commit a24b9c4

Browse files
author
José Valim
committed
Merge pull request #1510 from ericmj/mix-cmd-win
Dont escape " in shell commands on windows
2 parents f2addbb + 4c7ee1e commit a24b9c4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/mix/lib/mix/shell.ex

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,15 @@ defmodule Mix.Shell do
5656
# Finding shell command logic from :os.cmd in OTP
5757
# https://github.com/erlang/otp/blob/8deb96fb1d017307e22d2ab88968b9ef9f1b71d0/lib/kernel/src/os.erl#L184
5858
defp shell_command(command) do
59-
command = command
60-
|> String.replace("\"", "\\\"")
61-
|> to_char_list
62-
6359
case :os.type do
6460
{ :unix, _ } ->
61+
command = command
62+
|> String.replace("\"", "\\\"")
63+
|> to_char_list
6564
%c(sh -c "#{command}")
65+
6666
{ :win32, osname } ->
67+
command = to_char_list(command)
6768
case { System.get_env("COMSPEC"), osname } do
6869
{ nil, :windows } -> 'command.com /c #{command}'
6970
{ nil, _ } -> 'cmd /c #{command}'

0 commit comments

Comments
 (0)