diff options
| author | Xu Cheng | 2015-08-13 14:56:14 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-08-13 15:49:46 +0800 |
| commit | 638eda5f2d62afe157c4d2e55f8174edbdeb1e16 (patch) | |
| tree | fa35946189d462385ff159494a20f6edad4fcd30 /Library/Homebrew | |
| parent | 55d685f759619fe2c02792e0370a7142243f4b6f (diff) | |
| download | brew-638eda5f2d62afe157c4d2e55f8174edbdeb1e16.tar.bz2 | |
tap-info: fix for not installed tap
Closes Homebrew/homebrew#42890.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/cmd/tap-info.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/tap.rb | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/tap-info.rb b/Library/Homebrew/cmd/tap-info.rb index c4114fb98..1354264df 100644 --- a/Library/Homebrew/cmd/tap-info.rb +++ b/Library/Homebrew/cmd/tap-info.rb @@ -48,11 +48,11 @@ module Homebrew command_count = tap.command_files.size info += "#{command_count} command#{plural(command_count)} " if command_count > 0 info += "\n#{tap.path} (#{tap.path.abv})" + info += "\nFrom: #{tap.remote.nil? ? "N/A" : tap.remote}" else info += "Not installed" end puts info - puts "From: #{tap.remote.nil? ? "N/A" : tap.remote}" end end end diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 24b496ebe..9d92dbe96 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -123,20 +123,25 @@ class Tap end def to_hash - { + hash = { "name" => @name, "user" => @user, "repo" => @repo, "path" => @path.to_s, - "remote" => remote, "installed" => installed?, "official" => official?, - "custom_remote" => custom_remote?, "formula_names" => formula_names, "formula_files" => formula_files.map(&:to_s), "command_files" => command_files.map(&:to_s), "pinned" => pinned? } + + if installed? + hash["remote"] = remote + hash["custom_remote"] = custom_remote? + end + + hash end # Hash with tap formula renames |
