| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package App::GitGot::Command::chdir; | 
| 2 |  |  |  |  |  |  | our $AUTHORITY = 'cpan:GENEHACK'; | 
| 3 |  |  |  |  |  |  | $App::GitGot::Command::chdir::VERSION = '1.339'; | 
| 4 |  |  |  |  |  |  | # ABSTRACT: open a subshell in a selected project | 
| 5 | 15 |  |  | 15 |  | 179625 | use 5.014; | 
|  | 15 |  |  |  |  | 100 |  | 
| 6 |  |  |  |  |  |  |  | 
| 7 | 15 |  |  | 15 |  | 150 | use App::GitGot -command; | 
|  | 15 |  |  |  |  | 50 |  | 
|  | 15 |  |  |  |  | 222 |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 | 15 |  |  | 15 |  | 6725 | use Moo; | 
|  | 15 |  |  |  |  | 55 |  | 
|  | 15 |  |  |  |  | 216 |  | 
| 10 |  |  |  |  |  |  | extends 'App::GitGot::Command'; | 
| 11 | 15 |  |  | 15 |  | 5758 | use namespace::autoclean; | 
|  | 15 |  |  |  |  | 53 |  | 
|  | 15 |  |  |  |  | 222 |  | 
| 12 |  |  |  |  |  |  |  | 
| 13 | 44 |  |  | 44 | 1 | 470673 | sub command_names { qw/ chdir cd / } | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | sub _execute { | 
| 16 | 2 |  |  | 2 |  | 9 | my( $self, $opt, $args ) = @_; | 
| 17 |  |  |  |  |  |  |  | 
| 18 | 2 | 100 | 66 |  |  | 53 | unless ( $self->active_repos and $self->active_repos == 1 ) { | 
| 19 | 1 |  |  |  |  | 383 | say STDERR 'ERROR: You need to select a single repo'; | 
| 20 | 1 |  |  |  |  | 45 | exit(1); | 
| 21 |  |  |  |  |  |  | } | 
| 22 |  |  |  |  |  |  |  | 
| 23 | 1 |  |  |  |  | 161 | my( $repo ) = $self->active_repos; | 
| 24 |  |  |  |  |  |  |  | 
| 25 | 1 | 50 | 33 |  |  | 138 | chdir $repo->path | 
| 26 |  |  |  |  |  |  | or say STDERR "ERROR: Failed to chdir to repo ($!)" and exit(1); | 
| 27 |  |  |  |  |  |  |  | 
| 28 | 0 |  |  |  |  |  | exec $ENV{SHELL}; | 
| 29 |  |  |  |  |  |  | } | 
| 30 |  |  |  |  |  |  |  | 
| 31 |  |  |  |  |  |  | 1; | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  | ### FIXME docs | 
| 34 |  |  |  |  |  |  |  | 
| 35 |  |  |  |  |  |  | __END__ |