diff --git a/Library/Homebrew/unpack_strategy/zip.rb b/Library/Homebrew/unpack_strategy/zip.rb index de7c8b532e..c4c5fd301e 100644 --- a/Library/Homebrew/unpack_strategy/zip.rb +++ b/Library/Homebrew/unpack_strategy/zip.rb @@ -23,10 +23,12 @@ module UnpackStrategy .returns(SystemCommand::Result) } def extract_to_dir(unpack_dir, basename:, verbose:) - unzip = begin - Formula["unzip"] - rescue FormulaUnavailableError - nil + unzip = if which("unzip").blank? + begin + Formula["unzip"] + rescue FormulaUnavailableError + nil + end end with_env(TZ: "UTC") do