Skip to content

Commit

Permalink
tweak Hex.unpack_taball considering new change to hex_core (using ato…
Browse files Browse the repository at this point in the history
…m :all_files instead of empty list for unpacking all files)
  • Loading branch information
RudolfMan committed Jun 10, 2020
1 parent 50f290f commit e85ddc5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/diff/hex/hex.ex
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,17 @@ defmodule Diff.Hex do
end
end

def unpack_tarball(tarball, file_list \\ [], path) when is_binary(path) do
path = to_charlist(path)
def unpack_tarball(tarball, path) when is_binary(path) do
do_unpack_tarball(tarball, :all_files, path)
end

def unpack_tarball(tarball, file_list, path) when is_binary(path) do
file_list = Enum.map(file_list, &to_charlist/1)
do_unpack_tarball(tarball, file_list, path)
end

def do_unpack_tarball(tarball, file_list, path) do
path = to_charlist(path)

with {:ok, _} <- :hex_tarball.unpack(tarball, file_list, path) do
:ok
Expand Down

0 comments on commit e85ddc5

Please sign in to comment.