aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorAlyssa Ross2016-11-11 20:08:26 +0000
committerAlyssa Ross2016-11-14 12:13:34 +0000
commit3c310b2e3dd7805b04f48507c65c2c0a856c2aa2 (patch)
tree6349aa99f47facf9fb10b98e11301d84b79974a3 /Library/Homebrew/utils.rb
parent5294b99d6fa28b972ee4d695bda438bbf9e18647 (diff)
downloadbrew-3c310b2e3dd7805b04f48507c65c2c0a856c2aa2.tar.bz2
Warn developers when uninstalling a dependency
Suggested in #1084. Made the existing warning output entirely to STDERR, because previously the first line went to STDERR and subsequent ones went to STDOUT.
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index fce03f888..68557474d 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -376,6 +376,14 @@ ensure
trap("INT", std_trap)
end
+def capture_stderr
+ old, $stderr = $stderr, StringIO.new
+ yield
+ $stderr.string
+ensure
+ $stderr = old
+end
+
def nostdout
if ARGV.verbose?
yield