Skip to content
This repository has been archived by the owner on Aug 6, 2020. It is now read-only.

Commit

Permalink
FIX properly display Docker output
Browse files Browse the repository at this point in the history
  • Loading branch information
kwrooijen committed Apr 5, 2016
1 parent d4d0674 commit 6765494
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Check below for configuration options.
#### Add exrm_docker to your list of dependencies in `mix.exs`:

def deps do
[{:exrm_docker, "~> 0.0.3"}]
[{:exrm_docker, "~> 0.0.4"}]
end


Expand Down
14 changes: 10 additions & 4 deletions lib/exrm_docker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,18 @@ defmodule ExrmDocker do
File.write(@dockerfile, dockerfile_contents)
end

@spec docker_output(port) :: :ok
defp docker_output(port) do
@spec docker_output(port, String.t | nil) :: :ok
defp docker_output(port, last \\ nil) do
receive do
{^port, {:data, {_, data}}} ->
IO.puts(data)
docker_output(port)
if data |> String.contains?("\r") do
IO.write(data)
docker_output(port, data)
else
if last, do: IO.puts(last)
IO.puts(data)
docker_output(port)
end
{^port, {:exit_status, _}} ->
:ok
end
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule ExrmDocker.Mixfile do

def project do
[app: :exrm_docker,
version: "0.0.3",
version: "0.0.4",
elixir: "~> 1.2",
description: description,
package: package,
Expand Down

0 comments on commit 6765494

Please sign in to comment.