style: use popen_write to apply patches

This commit is contained in:
XuehaiPan 2021-11-08 20:10:30 +08:00
parent a56ab26e88
commit 67c619d4f2

View File

@ -181,8 +181,9 @@ module Homebrew
]
if fix
patch = system_command shellcheck, args: ["--format=diff", *args]
system_command "patch", args: ["-d", "/", "-p0"], input: patch.stdout
patches = system_command(shellcheck, args: ["--format=diff", *args]).stdout
patch_command = %w[patch -g 0 -f -d / -p0]
Utils.popen_write(*patch_command) { |p| p.write(patches) }
end
case output_type