From 5ab32eeadb85d1ced0fc6ea558a919bdfdb7748e Mon Sep 17 00:00:00 2001 From: Issy Long Date: Tue, 16 Jul 2024 22:07:31 -0400 Subject: [PATCH] formula_assertions: Fix `pipe_output` type sig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` ❯ brew test zstd ==> Testing zstd Error: zstd: failed An exception occurred within a child process: TypeError: Parameter 'cmd': Expected type String, got type Pathname with value # Caller: /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/z/zstd.rb:58 Definition: /opt/homebrew/Library/Homebrew/formula_assertions.rb:40 (Homebrew::Assertions#pipe_output) ``` --- Library/Homebrew/formula_assertions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_assertions.rb b/Library/Homebrew/formula_assertions.rb index a1741f6658..f0562fe33a 100644 --- a/Library/Homebrew/formula_assertions.rb +++ b/Library/Homebrew/formula_assertions.rb @@ -36,7 +36,7 @@ module Homebrew # optionally asserts the exit status. # # @api public - sig { params(cmd: String, input: T.nilable(String), result: T.nilable(Integer)).returns(String) } + sig { params(cmd: T.any(String, Pathname), input: T.nilable(String), result: T.nilable(Integer)).returns(String) } def pipe_output(cmd, input = nil, result = nil) ohai cmd output = IO.popen(cmd, "w+") do |pipe|