зеркало из https://github.com/github/ruby.git
ignore dump terminal
* tool/generic_erb.rb, tool/ifchange: no colorization if tput returned nothing or dump terminal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
8db48b11c6
Коммит
e712233387
|
@ -24,7 +24,7 @@ end
|
|||
unchanged = "unchanged"
|
||||
updated = "updated"
|
||||
if color or (color == nil && STDOUT.tty?)
|
||||
if (/\A(?:\e\[.*m|)\z/ =~ IO.popen("tput smso", "r", err: IO::NULL, &:read) rescue nil)
|
||||
if (/\A\e\[.*m\z/ =~ IO.popen("tput smso", "r", err: IO::NULL, &:read) rescue nil)
|
||||
beg = "\e["
|
||||
colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:\n]*)/)] : {}
|
||||
reset = "#{beg}m"
|
||||
|
|
|
@ -48,7 +48,7 @@ msg_begin= msg_unchanged= msg_updated= msg_reset=
|
|||
if [ "$color" = always -o \( "$color" = auto -a -t 1 \) ]; then
|
||||
msg_begin="["
|
||||
case "`tput smso 2>/dev/null`" in
|
||||
"$msg_begin"*m|"")
|
||||
"$msg_begin"*m)
|
||||
if [ ${TEST_COLORS:+set} ]; then
|
||||
msg_unchanged=`expr ":$TEST_COLORS:" : ".*:pass=\([^:]*\):"`
|
||||
msg_updated=`expr ":$TEST_COLORS:" : ".*:fail=\([^:]*\):"`
|
||||
|
|
Загрузка…
Ссылка в новой задаче