Skip to content

Commit

Permalink
Merge pull request #15796 from dduugg/widen-inreplace
Browse files Browse the repository at this point in the history
Widen paths type in Formula#inreplace
  • Loading branch information
MikeMcQuaid authored Aug 1, 2023
2 parents fad5e98 + da8a062 commit 54a3907
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2556,7 +2556,7 @@ def install; end
# @api public
sig {
params(
paths: T.any(T::Array[T.untyped], String, Pathname),
paths: T.any(T::Enumerable[T.untyped], String, Pathname),
before: T.nilable(T.any(Pathname, Regexp, String)),
after: T.nilable(T.any(Pathname, String, Symbol)),
audit_result: T::Boolean,
Expand All @@ -2566,8 +2566,7 @@ def inreplace(paths, before = nil, after = nil, audit_result = true) # rubocop:d
super(paths, before, after, audit_result)
rescue Utils::Inreplace::Error => e
onoe e.to_s
args = paths.is_a?(Array) ? paths : [paths]
raise BuildError.new(self, "inreplace", args, {})
raise BuildError.new(self, "inreplace", Array(paths), {})
end

protected
Expand Down

0 comments on commit 54a3907

Please sign in to comment.