Class: Space::Core::CLI::Repo::RepoList
- Inherits:
-
BaseCommand
- Object
- Dry::CLI::Command
- BaseCommand
- Space::Core::CLI::Repo::RepoList
- Defined in:
- lib/space_core/cli/repo.rb
Instance Method Summary collapse
Methods included from Helpers
#display_date, #handle_errors, #project_config, #render, #setup_terminal, #state, #store, #terminal
Instance Method Details
#call(**opts) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/space_core/cli/repo.rb', line 37 def call(**opts) setup_terminal(**opts.slice(:color, :colors)) handle_errors do render(store.repos) do |repos| if repos.empty? id = store.find.fmap(&:id).value_or("(unknown space)") terminal.say "No repos found in #{id}" next end rows = repos.map { |repo| [repo.fetch("full_name", repo["name"]), repo.fetch("path", "")] } terminal.say terminal.table(["Repo", "Path"], rows) CLI.record_outcome(Outcome.new(exit_code: 0)) end end end |