mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #1759 from reitermarkus/bsexec
Remove `:bsexec` parameter from `SystemCommand`.
This commit is contained in:
commit
4b5489e172
@ -46,7 +46,7 @@ module Hbc
|
||||
arguments = { executable: arguments } if arguments.is_a?(String)
|
||||
|
||||
# key sanity
|
||||
permitted_keys = [:args, :input, :executable, :must_succeed, :sudo, :bsexec, :print_stdout, :print_stderr]
|
||||
permitted_keys = [:args, :input, :executable, :must_succeed, :sudo, :print_stdout, :print_stderr]
|
||||
unknown_keys = arguments.keys - permitted_keys
|
||||
unless unknown_keys.empty?
|
||||
opoo %Q{Unknown arguments to #{description} -- #{unknown_keys.inspect} (ignored). Running "brew update; brew cleanup; brew cask cleanup" will likely fix it.}
|
||||
|
@ -48,13 +48,11 @@ module Hbc
|
||||
|
||||
def process_options!
|
||||
options.extend(HashValidator)
|
||||
.assert_valid_keys :input, :print_stdout, :print_stderr, :args, :must_succeed, :sudo, :bsexec
|
||||
.assert_valid_keys :input, :print_stdout, :print_stderr, :args, :must_succeed, :sudo
|
||||
sudo_prefix = %w[/usr/bin/sudo -E --]
|
||||
sudo_prefix = sudo_prefix.insert(1, "-A") unless ENV["SUDO_ASKPASS"].nil?
|
||||
bsexec_prefix = ["/bin/launchctl", "bsexec", options[:bsexec] == :startup ? "/" : options[:bsexec]]
|
||||
@command = [executable]
|
||||
options[:print_stderr] = true unless options.key?(:print_stderr)
|
||||
@command.unshift(*bsexec_prefix) if options[:bsexec]
|
||||
@command.unshift(*sudo_prefix) if options[:sudo]
|
||||
@command.concat(options[:args]) if options.key?(:args) && !options[:args].empty?
|
||||
@command[0] = Shellwords.shellescape(@command[0]) if @command.size == 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user