Use String.to_char_list when converting shell commands
We have found this bug as rebar failed to compile projects with non-latin characters on the path. Using String.to_char_list performs the proper conversion, passing the proper arguments to rebar.
This commit is contained in:
@@ -111,11 +111,11 @@ defmodule Mix.Shell do
|
||||
{:unix, _} ->
|
||||
command = command
|
||||
|> String.replace("\"", "\\\"")
|
||||
|> :binary.bin_to_list
|
||||
|> String.to_char_list
|
||||
'sh -c "' ++ command ++ '"'
|
||||
|
||||
{:win32, osname} ->
|
||||
command = :binary.bin_to_list(command)
|
||||
command = String.to_char_list(command)
|
||||
case {System.get_env("COMSPEC"), osname} do
|
||||
{nil, :windows} -> 'command.com /c ' ++ command
|
||||
{nil, _} -> 'cmd /c ' ++ command
|
||||
|
||||
Reference in New Issue
Block a user