diff options
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/doctor.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/help.rb | 11 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/info.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/install.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/list.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/update-report.rb | 5 |
6 files changed, 20 insertions, 22 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index df4bba419..cca2dca03 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -44,9 +44,9 @@ module Homebrew next if out.nil? || out.empty? if first_warning $stderr.puts <<-EOS.undent - #{Tty.white}Please note that these warnings are just used to help the Homebrew maintainers - with debugging if you file an issue. If everything you use Homebrew for is - working fine: please don't worry and just ignore them. Thanks!#{Tty.reset} + #{Tty.bold}Please note that these warnings are just used to help the Homebrew maintainers + with debugging if you file an issue. If everything you use Homebrew for is + working fine: please don't worry and just ignore them. Thanks!#{Tty.reset} EOS end diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb index 793c765ca..982e24965 100644 --- a/Library/Homebrew/cmd/help.rb +++ b/Library/Homebrew/cmd/help.rb @@ -41,6 +41,8 @@ module Homebrew if cmd cmd = HOMEBREW_INTERNAL_COMMAND_ALIASES.fetch(cmd, cmd) path = Commands.path(cmd) + path ||= which("brew-#{cmd}") + path ||= which("brew-#{cmd}.rb") end # Display command-specific (or generic) help in response to `UsageError`. @@ -63,7 +65,7 @@ module Homebrew exit 0 end - # Resume execution in `brew.rb` for external/unknown commands. + # Resume execution in `brew.rb` for unknown commands. return if path.nil? # Display help for internal command (or generic help if undocumented). @@ -79,9 +81,10 @@ module Homebrew else help_lines.map do |line| line.slice(2..-1) - .sub(/^ \* /, "#{Tty.highlight}brew#{Tty.reset} ") - .gsub(/`(.*?)`/, "#{Tty.highlight}\\1#{Tty.reset}") - .gsub(/<(.*?)>/, "#{Tty.em}\\1#{Tty.reset}") + .sub(/^ \* /, "#{Tty.bold}brew#{Tty.reset} ") + .gsub(/`(.*?)`/, "#{Tty.bold}\\1#{Tty.reset}") + .gsub(%r{<([^\s]+?://[^\s]+?)>}) { |url| Formatter.url(url) } + .gsub(/<(.*?)>/, "#{Tty.underline}\\1#{Tty.reset}") .gsub("@hide_from_man_page", "") end.join.strip end diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 857f1090e..fefabf85f 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -119,7 +119,7 @@ module Homebrew puts "#{f.full_name}: #{specs * ", "}#{" [#{attrs * ", "}]" unless attrs.empty?}" puts f.desc if f.desc - puts "#{Tty.em}#{f.homepage}#{Tty.reset}" if f.homepage + puts Formatter.url(f.homepage) if f.homepage conflicts = f.conflicts.map(&:name).sort! puts "Conflicts with: #{conflicts*", "}" unless conflicts.empty? @@ -135,7 +135,7 @@ module Homebrew end end - puts "From: #{Tty.em}#{github_info(f)}#{Tty.reset}" + puts "From: #{Formatter.url(github_info(f))}" unless f.deps.empty? ohai "Dependencies" diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 328df07ce..ffb7eeab3 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -201,16 +201,6 @@ module Homebrew puts_columns(taps_search_results) puts "To install one of them, run (for example):\n brew install #{taps_search_results.first}" end - - # If they haven't updated in 48 hours (172800 seconds), that - # might explain the error - master = HOMEBREW_REPOSITORY/".git/refs/heads/master" - return unless master.exist? && (Time.now.to_i - File.mtime(master).to_i) > 172800 - ohai "You haven't updated Homebrew in a while." - puts <<-EOS.undent - A formula for #{e.name} might have been added recently. - Run `brew update` to get the latest Homebrew updates! - EOS end end end diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index ac13d9c86..01af678a7 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -106,7 +106,11 @@ module Homebrew names = if ARGV.named.empty? Formula.racks else - ARGV.named.map { |n| HOMEBREW_CELLAR+n }.select(&:exist?) + racks = ARGV.named.map { |n| HOMEBREW_CELLAR+n } + racks.select do |rack| + Homebrew.failed = true unless rack.exist? + rack.exist? + end end if ARGV.include? "--pinned" pinned_versions = {} diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index a7077d8db..a76167feb 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -113,6 +113,7 @@ module Homebrew end def install_core_tap_if_necessary + return if ENV["HOMEBREW_UPDATE_TEST"] core_tap = CoreTap.instance return if core_tap.installed? CoreTap.ensure_installed! quiet: false @@ -282,13 +283,13 @@ module Homebrew EOS rescue => e ofail <<-EOS.undent - #{Tty.white}Failed to migrate HOMEBREW_REPOSITORY to #{new_homebrew_repository}! + #{Tty.bold}Failed to migrate HOMEBREW_REPOSITORY to #{new_homebrew_repository}!#{Tty.reset} The error was: #{e} Please try to resolve this error yourself and then run `brew update` again to complete the migration. If you need help please +1 an existing error or comment with your new error in issue: - #{Tty.em}https://github.com/Homebrew/brew/issues/987#{Tty.reset} + #{Formatter.url("https://github.com/Homebrew/brew/issues/987")} EOS $stderr.puts e.backtrace end |
