Hi friends, I have a block code like this; for example if my user goes to a wrong directory and call this function he/she gets errors.
def deps() do
[{:get, "deps.get"}, {:compile, "deps.compile"}]
|> Enum.map(fn {operation, command} ->
{stream, status} = System.cmd("mix", [command], into: IO.stream())
%{operation: operation, output: stream, status: status}
end)
end
The error my user gets is like this:
** (Mix) Could not find a Mix.Project, please ensure you are running Mix in a directory with a mix.exs file
** (Mix) Could not find a Mix.Project, please ensure you are running Mix in a directory with a mix.exs file
but I need to print it like this:
** (Mix) Could not find a Mix.Project, please ensure you are running Mix in a directory with a mix.exs file
** (Mix) Could not find a Mix.Project, please ensure you are running Mix in a directory with a mix.exs file
Each line should have something like /n
to make the lines break.
Thank you