dev-cmd/cat: require "formula" only when necessary

This commit is contained in:
XuehaiPan 2021-11-23 21:35:44 +08:00
parent 687dbe5268
commit c6719e5854

View File

@ -2,7 +2,6 @@
# frozen_string_literal: true
require "cli/parser"
require "formula"
module Homebrew
extend T::Sig
@ -32,6 +31,8 @@ module Homebrew
cd HOMEBREW_REPOSITORY
pager = if Homebrew::EnvConfig.bat?
require "formula"
unless Formula["bat"].any_version_installed?
# The user might want to capture the output of `brew cat ...`
# Redirect stdout to stderr