dev-cmd/contributions: Use Utils.safe_popen_read not backticks

This commit is contained in:
Issy Long 2022-07-25 10:43:55 +01:00
parent f6b2fe5093
commit 70c300daf2
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -84,7 +84,7 @@ module Homebrew
cmd += " --before=#{args[:to]}" if args[:to]
cmd += " --after=#{args[:from]}" if args[:from]
`#{cmd} | wc -l`.strip.to_i
Utils.safe_popen_read(cmd).lines.count
end
sig { params(repo_path: Pathname, args: Homebrew::CLI::Args).returns(Integer) }
@ -95,6 +95,6 @@ module Homebrew
cmd += " --after=#{args[:from]}" if args[:from]
cmd += " | grep #{args.named.first}"
`#{cmd} | wc -l`.strip.to_i
Utils.safe_popen_read(cmd).lines.count
end
end