Skip to content

Commit 59114ef

Browse files
pmeinhardtandreasknoepfle
authored andcommitted
Use context for tar pipe
1 parent 1fcfc0e commit 59114ef

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/tarpipe.exs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ end
2121

2222
:ok =
2323
with {:ok, chan} <- SSHKit.Channel.open(conn, []) do
24-
# command = SSHKit.Context.build(ctx, "tar -x")
25-
command = "tar -x -C #{ctx.path}"
26-
IO.puts(command)
24+
command = SSHKit.Context.build(ctx, "tar -x")
2725

2826
case SSHKit.Channel.exec(chan, command) do
2927
:success ->
28+
# In case of failed upload, check command output:
29+
# IO.inspect(SSHKit.Channel.recv(chan))
30+
3031
{:ok, tar} = :erl_tar.init(self(), :write, fn
3132
:position, {_, position} ->
3233
# IO.write("tar position: #{inspect(position)}")

0 commit comments

Comments
 (0)