aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2016-11-11 10:56:05 +0100
committerGitHub2016-11-11 10:56:05 +0100
commit8fea516dcdc68680c4841d2547be209f16d32203 (patch)
tree83aae0d32299c0e9b6560c1b1d4d098ebef163ca /Library
parent2ce17a11379a45e5de7e09a57681006aca5206bd (diff)
parent0b8a8cce28a377ca5c647415f390461d998c172e (diff)
downloadbrew-8fea516dcdc68680c4841d2547be209f16d32203.tar.bz2
Merge pull request #1481 from reitermarkus/sudo-askpass
Support `SUDO_ASKPASS` environment variable in `brew cask`.
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)