2023-08-08 13:54:59 -07:00
|
|
|
# typed: strict
|
2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-04-01 16:02:41 -07:00
|
|
|
require "abstract_command"
|
2016-04-17 09:21:02 +02:00
|
|
|
|
2014-06-18 22:41:47 -05:00
|
|
|
module Homebrew
|
2024-04-01 16:02:41 -07:00
|
|
|
module Cmd
|
|
|
|
class Repository < AbstractCommand
|
|
|
|
sig { override.returns(String) }
|
|
|
|
def self.command_name = "--repository"
|
2016-09-26 01:44:51 +02:00
|
|
|
|
2024-04-01 16:02:41 -07:00
|
|
|
cmd_args do
|
|
|
|
description <<~EOS
|
|
|
|
Display where Homebrew's Git repository is located.
|
2019-01-30 21:29:49 +00:00
|
|
|
|
2024-04-01 16:02:41 -07:00
|
|
|
If <user>`/`<repo> are provided, display where tap <user>`/`<repo>'s directory is located.
|
|
|
|
EOS
|
2021-01-10 14:26:40 -05:00
|
|
|
|
2024-04-01 16:02:41 -07:00
|
|
|
named_args :tap
|
|
|
|
end
|
2019-01-30 21:29:49 +00:00
|
|
|
|
2024-04-01 16:02:41 -07:00
|
|
|
sig { override.void }
|
|
|
|
def run
|
|
|
|
if args.no_named?
|
|
|
|
puts HOMEBREW_REPOSITORY
|
|
|
|
else
|
|
|
|
puts args.named.to_taps.map(&:path)
|
|
|
|
end
|
|
|
|
end
|
2016-03-23 16:33:40 +08:00
|
|
|
end
|
2010-09-11 20:22:54 +01:00
|
|
|
end
|
|
|
|
end
|