Class: Space::Core::CLI::Status

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/space_core/cli/status.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(rest: [], **opts) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/space_core/cli/status.rb', line 8

def call(rest: [], **opts)
  setup_terminal(**opts.slice(:color, :colors))
  handle_errors do
    identifier, status_value = parse_status_args(Array(rest))
    render(store.find(identifier)) do |space|
      space.update_status(status_value)
      terminal.success "#{space.id} is #{space.status}"
      CLI.record_outcome(Outcome.new(exit_code: 0))
    end
  end
end