From 8fd3eb5a2cceb2f48244e3cb1fa11a1a71fc9601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 30 Oct 2015 11:28:13 -0200 Subject: [PATCH] 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. --- lib/mix/lib/mix/shell.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mix/lib/mix/shell.ex b/lib/mix/lib/mix/shell.ex index 6c7eb9d9a5..effb2c8356 100644 --- a/lib/mix/lib/mix/shell.ex +++ b/lib/mix/lib/mix/shell.ex @@ -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