Skip to content

Commit e889b26

Browse files
pmeinhardtandreasknoepfle
authored andcommitted
Fix path nesting for tar pipe example
1 parent c261aed commit e889b26

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
@@ -20,6 +20,8 @@ defmodule Xfer do
2020
end
2121
end
2222

23+
source = "test/fixtures"
24+
2325
:ok =
2426
with {:ok, chan} <- SSHKit.Channel.open(conn, []) do
2527
command = SSHKit.Context.build(ctx, "tar -x")
@@ -35,6 +37,7 @@ end
3537
{:ok, 0}
3638

3739
:write, {^chan, data} ->
40+
# TODO: Send data in chunks based on channel window size?
3841
:ok = SSHKit.Channel.send(chan, Xfer.to_binary(data))
3942
:ok
4043

@@ -43,9 +46,7 @@ end
4346
:ok
4447
end)
4548

46-
source = "test/fixtures"
47-
48-
:ok = :erl_tar.add(tar, to_charlist(source), to_charlist(source))
49+
:ok = :erl_tar.add(tar, to_charlist(source), to_charlist(Path.basename(source)), [])
4950

5051
:ok = :erl_tar.close(tar)
5152

0 commit comments

Comments
 (0)