cask/info: send missing args after removing openstruct
This seems like it was a bug before the recent change to remove OpenStruct from `Homebrew::CLI::Args` but it was failing silently before. Now we pass the args to the `Cask::Info.info` method so that when they eventually reach the `Utils::Analytics.output_analytics` method they are present as expected. Example error fragment: ```console $ set -e HOMEBREW_NO_ANALYTICS $ brew info iterm2 --cask --verbose ==> iterm2: 3.5.10 (auto_updates) https://iterm2.com/ Installed /usr/local/Caskroom/iterm2/3.5.4 (91.7MB) From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/i/iterm2.rb ==> Name iTerm2 ==> Description Terminal emulator as alternative to Apple's Terminal app ==> Artifacts iTerm.app (App) Error: undefined method `analytics?' for an instance of Homebrew::CLI::Args /usr/local/Homebrew/Library/Homebrew/utils/analytics.rb:248:in `output_analytics' /usr/local/Homebrew/Library/Homebrew/utils/analytics.rb:342:in `cask_output' /usr/local/Homebrew/Library/Homebrew/cask/info.rb:39:in `info' ```
This commit is contained in:
parent
0bcb7648ce
commit
8bee0555b9
@ -31,12 +31,12 @@ module Cask
|
||||
output
|
||||
end
|
||||
|
||||
sig { params(cask: Cask).void }
|
||||
def self.info(cask)
|
||||
sig { params(cask: Cask, args: Homebrew::Cmd::Info::Args).void }
|
||||
def self.info(cask, args:)
|
||||
puts get_info(cask)
|
||||
|
||||
require "utils/analytics"
|
||||
::Utils::Analytics.cask_output(cask, args: Homebrew::CLI::Args.new)
|
||||
::Utils::Analytics.cask_output(cask, args:)
|
||||
end
|
||||
|
||||
sig { params(cask: Cask).returns(String) }
|
||||
|
@ -382,7 +382,7 @@ module Homebrew
|
||||
def info_cask(cask)
|
||||
require "cask/info"
|
||||
|
||||
Cask::Info.info(cask)
|
||||
Cask::Info.info(cask, args:)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user