unpack_strategy/zip: avoid loading formulae unnecessarily
If we already have `unzip` in `PATH`, let's skip trying to load the `unzip` formula.
This commit is contained in:
parent
8917acac95
commit
0867534f3e
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user