Merge pull request #17879 from Homebrew/kernel_require_utils

This commit is contained in:
Mike McQuaid 2024-07-26 20:02:00 +01:00 committed by GitHub
commit 04621bab95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -264,6 +264,8 @@ module Kernel
# Kernel.system but with exceptions. # Kernel.system but with exceptions.
def safe_system(cmd, *args, **options) def safe_system(cmd, *args, **options)
require "utils"
return if Homebrew.system(cmd, *args, **options) return if Homebrew.system(cmd, *args, **options)
raise ErrorDuringExecution.new([cmd, *args], status: $CHILD_STATUS) raise ErrorDuringExecution.new([cmd, *args], status: $CHILD_STATUS)
@ -273,6 +275,8 @@ module Kernel
# #
# @api internal # @api internal
def quiet_system(cmd, *args) def quiet_system(cmd, *args)
require "utils"
Homebrew._system(cmd, *args) do Homebrew._system(cmd, *args) do
# Redirect output streams to `/dev/null` instead of closing as some programs # Redirect output streams to `/dev/null` instead of closing as some programs
# will fail to execute if they can't write to an open stream. # will fail to execute if they can't write to an open stream.