mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
cmd/config: Add core cask tap to output
This information is occasionally useful when debugging so we should include it by default to make our lives easier.
This commit is contained in:
parent
d1625b6e3d
commit
536b37c766
@ -29,6 +29,11 @@ module SystemConfig
|
|||||||
@clt ||= MacOS::CLT.version if MacOS::CLT.installed?
|
@clt ||= MacOS::CLT.version if MacOS::CLT.installed?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def core_tap_config(out = $stdout)
|
||||||
|
dump_tap_config(CoreTap.instance, out)
|
||||||
|
dump_tap_config(CoreCaskTap.instance, out)
|
||||||
|
end
|
||||||
|
|
||||||
def dump_verbose_config(out = $stdout)
|
def dump_verbose_config(out = $stdout)
|
||||||
dump_generic_verbose_config(out)
|
dump_generic_verbose_config(out)
|
||||||
out.puts "macOS: #{MacOS.full_version}-#{kernel}"
|
out.puts "macOS: #{MacOS.full_version}-#{kernel}"
|
||||||
|
@ -50,26 +50,6 @@ module SystemConfig
|
|||||||
homebrew_repo.origin_url || "(none)"
|
homebrew_repo.origin_url || "(none)"
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(String) }
|
|
||||||
def core_tap_head
|
|
||||||
CoreTap.instance.git_head || "(none)"
|
|
||||||
end
|
|
||||||
|
|
||||||
sig { returns(String) }
|
|
||||||
def core_tap_last_commit
|
|
||||||
CoreTap.instance.git_last_commit || "never"
|
|
||||||
end
|
|
||||||
|
|
||||||
sig { returns(String) }
|
|
||||||
def core_tap_branch
|
|
||||||
CoreTap.instance.git_branch || "(none)"
|
|
||||||
end
|
|
||||||
|
|
||||||
sig { returns(String) }
|
|
||||||
def core_tap_origin
|
|
||||||
CoreTap.instance.remote
|
|
||||||
end
|
|
||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def describe_clang
|
def describe_clang
|
||||||
return "N/A" if clang.null?
|
return "N/A" if clang.null?
|
||||||
@ -128,19 +108,34 @@ module SystemConfig
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def core_tap_config(out = $stdout)
|
def dump_tap_config(tap, out = $stdout)
|
||||||
if CoreTap.instance.installed?
|
case tap
|
||||||
out.puts "Core tap origin: #{core_tap_origin}"
|
when CoreTap
|
||||||
out.puts "Core tap HEAD: #{core_tap_head}"
|
tap_name = "Core tap"
|
||||||
out.puts "Core tap last commit: #{core_tap_last_commit}"
|
json_file_name = "formula.jws.json"
|
||||||
out.puts "Core tap branch: #{core_tap_branch}"
|
when CoreCaskTap
|
||||||
|
tap_name = "Core cask tap"
|
||||||
|
json_file_name = "cask.jws.json"
|
||||||
|
else
|
||||||
|
raise ArgumentError, "Unknown tap: #{tap}"
|
||||||
end
|
end
|
||||||
|
|
||||||
if (formula_json = Homebrew::API::HOMEBREW_CACHE_API/"formula.jws.json") && formula_json.exist?
|
if tap.installed?
|
||||||
out.puts "Core tap JSON: #{formula_json.mtime.utc.strftime("%d %b %H:%M UTC")}"
|
out.puts "#{tap_name} origin: #{tap.remote}"
|
||||||
elsif !CoreTap.instance.installed?
|
out.puts "#{tap_name} HEAD: #{tap.git_head || "(none)"}"
|
||||||
out.puts "Core tap: N/A"
|
out.puts "#{tap_name} last commit: #{tap.git_last_commit || "never"}"
|
||||||
|
out.puts "#{tap_name} branch: #{tap.git_branch || "(none)"}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if (json_file = Homebrew::API::HOMEBREW_CACHE_API/json_file_name) && json_file.exist?
|
||||||
|
out.puts "#{tap_name} JSON: #{json_file.mtime.utc.strftime("%d %b %H:%M UTC")}"
|
||||||
|
elsif !tap.installed?
|
||||||
|
out.puts "#{tap_name}: N/A"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def core_tap_config(out = $stdout)
|
||||||
|
dump_tap_config(CoreTap.instance, out)
|
||||||
end
|
end
|
||||||
|
|
||||||
def homebrew_config(out = $stdout)
|
def homebrew_config(out = $stdout)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user