settings: use quieter system_command!

`safe_system` always outputs what it's running which isn't necessary in
this case.
This commit is contained in:
Mike McQuaid 2021-04-14 14:21:16 +01:00
parent 4862463aa8
commit a74d6060f3
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -1,12 +1,15 @@
# typed: true # typed: true
# frozen_string_literal: true # frozen_string_literal: true
require "system_command"
module Homebrew module Homebrew
# Helper functions for reading and writing settings. # Helper functions for reading and writing settings.
# #
# @api private # @api private
module Settings module Settings
extend T::Sig extend T::Sig
include SystemCommand::Mixin
module_function module_function
@ -24,7 +27,7 @@ module Homebrew
return unless (repo/".git/config").exist? return unless (repo/".git/config").exist?
repo.cd do repo.cd do
safe_system "git", "config", "--replace-all", "homebrew.#{setting}", value.to_s system_command! "git", args: ["config", "--replace-all", "homebrew.#{setting}", value.to_s]
end end
end end
@ -34,7 +37,7 @@ module Homebrew
return if read(setting, repo: repo).blank? return if read(setting, repo: repo).blank?
repo.cd do repo.cd do
safe_system "git", "config", "--unset-all", "homebrew.#{setting}" system_command! "git", args: ["config", "--unset-all", "homebrew.#{setting}"]
end end
end end
end end