tap-info: fix for not installed tap
Closes Homebrew/homebrew#42890. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
55d685f759
commit
638eda5f2d
@ -48,11 +48,11 @@ module Homebrew
|
|||||||
command_count = tap.command_files.size
|
command_count = tap.command_files.size
|
||||||
info += "#{command_count} command#{plural(command_count)} " if command_count > 0
|
info += "#{command_count} command#{plural(command_count)} " if command_count > 0
|
||||||
info += "\n#{tap.path} (#{tap.path.abv})"
|
info += "\n#{tap.path} (#{tap.path.abv})"
|
||||||
|
info += "\nFrom: #{tap.remote.nil? ? "N/A" : tap.remote}"
|
||||||
else
|
else
|
||||||
info += "Not installed"
|
info += "Not installed"
|
||||||
end
|
end
|
||||||
puts info
|
puts info
|
||||||
puts "From: #{tap.remote.nil? ? "N/A" : tap.remote}"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -123,20 +123,25 @@ class Tap
|
|||||||
end
|
end
|
||||||
|
|
||||||
def to_hash
|
def to_hash
|
||||||
{
|
hash = {
|
||||||
"name" => @name,
|
"name" => @name,
|
||||||
"user" => @user,
|
"user" => @user,
|
||||||
"repo" => @repo,
|
"repo" => @repo,
|
||||||
"path" => @path.to_s,
|
"path" => @path.to_s,
|
||||||
"remote" => remote,
|
|
||||||
"installed" => installed?,
|
"installed" => installed?,
|
||||||
"official" => official?,
|
"official" => official?,
|
||||||
"custom_remote" => custom_remote?,
|
|
||||||
"formula_names" => formula_names,
|
"formula_names" => formula_names,
|
||||||
"formula_files" => formula_files.map(&:to_s),
|
"formula_files" => formula_files.map(&:to_s),
|
||||||
"command_files" => command_files.map(&:to_s),
|
"command_files" => command_files.map(&:to_s),
|
||||||
"pinned" => pinned?
|
"pinned" => pinned?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if installed?
|
||||||
|
hash["remote"] = remote
|
||||||
|
hash["custom_remote"] = custom_remote?
|
||||||
|
end
|
||||||
|
|
||||||
|
hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# Hash with tap formula renames
|
# Hash with tap formula renames
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user