aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhiming Wang2016-09-17 03:01:47 -0400
committerZhiming Wang2016-09-17 03:01:47 -0400
commitf8d774554775a3efdb905f0a55873cce545890c1 (patch)
treeae812db833142e9ded1917e43e5b2eeeb2b57c1e
parenta54c96825b2c490b2b29f4214de44cf146ea7744 (diff)
downloadbrew-f8d774554775a3efdb905f0a55873cce545890c1.tar.bz2
formula: set TERM to dumb during test
Software that tries to print different things (e.g. ANSI color) based on different termcaps often relies on the TERM environment variable, and could fail without it. This results in confusing test issues where certain tests can be successfully run by users testing locally with TERM set, but choke up on our CI. Always setting TERM to dumb leads to better consistency between local tests and CI tests, and saves much probing in certain cases.
-rw-r--r--Library/Homebrew/formula.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 2c24c93d7..88f53a6d1 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -1434,8 +1434,10 @@ class Formula
old_tmpdir = ENV["TMPDIR"]
old_temp = ENV["TEMP"]
old_tmp = ENV["TMP"]
+ old_term = ENV["TERM"]
ENV["CURL_HOME"] = old_curl_home || old_home
ENV["TMPDIR"] = ENV["TEMP"] = ENV["TMP"] = HOMEBREW_TEMP
+ ENV["TERM"] = "dumb"
mktemp("#{name}-test") do |staging|
staging.retain! if ARGV.keep_tmp?
@testpath = staging.tmpdir
@@ -1457,6 +1459,7 @@ class Formula
ENV["TMPDIR"] = old_tmpdir
ENV["TEMP"] = old_temp
ENV["TMP"] = old_tmp
+ ENV["TERM"] = old_term
end
# @private