style: use HOMEBREW_RUBY_EXEC_ARGS

This commit is contained in:
Bo Anderson 2022-11-05 03:05:58 +00:00
parent 8036b70ead
commit e03548fc7a
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -143,6 +143,7 @@ module Homebrew
FileUtils.rm_rf cache_env["XDG_CACHE_HOME"] if reset_cache
ruby_args = HOMEBREW_RUBY_EXEC_ARGS.dup
case output_type
when :print
args << "--debug" if debug
@ -153,11 +154,11 @@ module Homebrew
args << "--color" if Tty.color?
system cache_env, RUBY_PATH, RUBOCOP, *args
system cache_env, *ruby_args, "--", RUBOCOP, *args
$CHILD_STATUS.success?
when :json
result = system_command RUBY_PATH,
args: [RUBOCOP, "--format", "json", *args],
result = system_command ruby_args.shift,
args: [*ruby_args, "--", RUBOCOP, "--format", "json", *args],
env: cache_env
json = json_result!(result)
json["files"]