aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2016-11-11 00:30:05 +0100
committerMarkus Reiter2016-11-11 00:30:05 +0100
commit0b8a8cce28a377ca5c647415f390461d998c172e (patch)
tree11a0cf982cb8531be75270c7d2870ffc41535992 /Library
parent42bb0f8c4d035762e3c1c3b99ee8202504377441 (diff)
downloadbrew-0b8a8cce28a377ca5c647415f390461d998c172e.tar.bz2
Support `SUDO_ASKPASS` environment variable.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/system_command.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/system_command.rb b/Library/Homebrew/cask/lib/hbc/system_command.rb
index de544f1b7..638069386 100644
--- a/Library/Homebrew/cask/lib/hbc/system_command.rb
+++ b/Library/Homebrew/cask/lib/hbc/system_command.rb
@@ -50,6 +50,7 @@ module Hbc
options.extend(HashValidator)
.assert_valid_keys :input, :print_stdout, :print_stderr, :args, :must_succeed, :sudo, :bsexec
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)