From 2e4185a5250fb0349a5722c3b20f4cdb16c2a0ac Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Thu, 23 Dec 2021 14:58:51 -0500 Subject: [PATCH] Fix `brew typecheck` --- Library/Homebrew/utils/inreplace.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb index f3f24089be..35f7b19ae9 100644 --- a/Library/Homebrew/utils/inreplace.rb +++ b/Library/Homebrew/utils/inreplace.rb @@ -56,7 +56,7 @@ module Utils errors["`paths` (first) parameter"] = ["`paths` was empty"] if paths.blank? Array(paths).each do |path| - str = File.binread(path) || "" + str = File.binread(path) s = StringInreplaceExtension.new(str) if before.nil? && after.nil? @@ -75,7 +75,7 @@ module Utils # @api private def inreplace_pairs(path, replacement_pairs, read_only_run: false, silent: false) - str = File.binread(path) || "" + str = File.binread(path) contents = StringInreplaceExtension.new(str) replacement_pairs.each do |old, new| ohai "replace #{old.inspect} with #{new.inspect}" unless silent