| 1 | # ABSTRACT: Re-enable automated agent runs on this board | ||
| 2 | |||
| 3 | package App::karr::Cmd::Enable; | ||
| 4 | our $VERSION = '0.602'; | ||
| 5 | use Moo; | ||
| 6 | use MooX::Cmd; | ||
| 7 | use MooX::Options ( | ||
| 8 | usage_string => 'USAGE: karr enable [--json]', | ||
| 9 | ); | ||
| 10 | use App::karr::Role::BoardAccess; | ||
| 11 | use App::karr::Role::Output; | ||
| 12 | |||
| 13 | with 'App::karr::Role::BoardAccess', 'App::karr::Role::Output'; | ||
| 14 | |||
| 15 | |||
| 16 | sub execute { | ||
| 17 | my ($self, $args_ref, $chain_ref) = @_; | ||
| 18 | |||
| 19 | $self->check_positional_args($args_ref, 0); | ||
| 20 | |||
| 21 | $self->sync_before; | ||
| 22 | $self->require_board; | ||
| 23 | $self->store->set_foundation_enabled(1); | ||
| 24 | $self->sync_after; | ||
| 25 | |||
| 26 | if ($self->json) { | ||
| 27 | $self->print_json({ foundation => { enabled => 1 } }); | ||
| 28 | return; | ||
| 29 | } | ||
| 30 | |||
| 31 | print "Board enabled for automated agent runs (karr-foundation).\n"; | ||
| 32 | } | ||
| 33 | |||
| 34 | 1; | ||
| 35 | |||
| 36 | __END__ |