Merge pull request #15498 from carlocab/zip-no-load-formula

unpack_strategy/zip: avoid loading formulae unnecessarily
This commit is contained in:
Carlo Cabrera 2023-05-31 00:21:14 +08:00 committed by GitHub
commit a380aed887
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,10 +23,12 @@ module UnpackStrategy
.returns(SystemCommand::Result) .returns(SystemCommand::Result)
} }
def extract_to_dir(unpack_dir, basename:, verbose:) def extract_to_dir(unpack_dir, basename:, verbose:)
unzip = begin unzip = if which("unzip").blank?
Formula["unzip"] begin
rescue FormulaUnavailableError Formula["unzip"]
nil rescue FormulaUnavailableError
nil
end
end end
with_env(TZ: "UTC") do with_env(TZ: "UTC") do