Clean up some impl [GH-666]
This commit is contained in:
parent
b9046a5594
commit
97235ee080
|
@ -15,7 +15,7 @@
|
||||||
uses this. [GH-661]
|
uses this. [GH-661]
|
||||||
- If there is only one bridgable interface, use that without asking
|
- If there is only one bridgable interface, use that without asking
|
||||||
the user. [GH-655]
|
the user. [GH-655]
|
||||||
|
- The shell will have color output if ANSICON is installed on Windows. [GH-666]
|
||||||
## 0.9.1 (January 18, 2012)
|
## 0.9.1 (January 18, 2012)
|
||||||
|
|
||||||
- Use `ifconfig device down` instead of `ifdown`. [GH-649]
|
- Use `ifconfig device down` instead of `ifdown`. [GH-649]
|
||||||
|
|
|
@ -19,7 +19,7 @@ opts = {}
|
||||||
# Disable color if the proper argument was passed or if we're
|
# Disable color if the proper argument was passed or if we're
|
||||||
# on Windows since the default Windows terminal doesn't support
|
# on Windows since the default Windows terminal doesn't support
|
||||||
# colors.
|
# colors.
|
||||||
if !Vagrant::Util::Platform.terminal_supports_colors?
|
if ARGV.include?("--no-color") || !$stdout.tty? || !Vagrant::Util::Platform.terminal_supports_colors?
|
||||||
# Delete the argument from the list so that it doesn't cause any
|
# Delete the argument from the list so that it doesn't cause any
|
||||||
# invalid arguments down the road.
|
# invalid arguments down the road.
|
||||||
ARGV.delete("--no-color")
|
ARGV.delete("--no-color")
|
||||||
|
|
|
@ -44,9 +44,14 @@ module Vagrant
|
||||||
!bit64?
|
!bit64?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns a boolean noting whether the terminal supports color.
|
||||||
|
# output.
|
||||||
def terminal_supports_colors?
|
def terminal_supports_colors?
|
||||||
!$stdout.tty? || ARGV.include?("--no-color") ||
|
if windows?
|
||||||
(Vagrant::Util::Platform.windows? ? ENV['ansicon'] : false)
|
return ENV.has_key?("ANSICON")
|
||||||
|
end
|
||||||
|
|
||||||
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
def tar_file_options
|
def tar_file_options
|
||||||
|
|
Loading…
Reference in New Issue