Skip to content

Commit ccd5dee

Browse files
authored
Merge pull request #159 from mhanberg/use-7zz
Use 7zz if available
2 parents 4a6a7e2 + 64192f0 commit ccd5dee

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/burrito.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ defmodule Burrito do
2424
exit(1)
2525
end
2626

27-
if Enum.any?(~w(7z), &(System.find_executable(&1) == nil)) do
27+
if Enum.any?(~w(7z 7zz), &(System.find_executable(&1) == nil)) do
2828
Log.warning(
2929
:build,
30-
"We couldn't find 7z in your PATH, 7z is required to build Windows releases. They will fail if you don't fix this!"
30+
"We couldn't find 7z/7zz in your PATH, 7z/7zz is required to build Windows releases. They will fail if you don't fix this!"
3131
)
3232
end
3333

lib/util/default_erts_resolver.ex

+7-1
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,16 @@ defmodule Burrito.Util.DefaultERTSResolver do
7070
extraction_path = System.tmp_dir!() |> Path.join(["unpacked_erts_#{random_id}"])
7171
File.mkdir_p!(extraction_path)
7272

73+
seven_z =
74+
with nil <- System.find_executable("7zz"),
75+
nil <- System.find_executable("7z") do
76+
raise "Couldn't find 7z/7zz"
77+
end
78+
7379
# we use 7z to unpack windows setup files, otherwise we use tar
7480
command =
7581
case target.os do
76-
:windows -> ~c"7z x #{tar_dest_path} -o#{extraction_path}/otp-windows/"
82+
:windows -> ~c"#{seven_z} x #{tar_dest_path} -o#{extraction_path}/otp-windows/"
7783
_ -> ~c"tar xzf #{tar_dest_path} -C #{extraction_path}"
7884
end
7985

0 commit comments

Comments
 (0)