| 1 | package App::GitGot::Command::chdir; | |||||||||||||||||||||||||||||||||
| 2 | 16 | our $AUTHORITY = 'cpan:GENEHACK'; | ||||||||||||||||||||||||||||||||
| 3 | 16 | $App::GitGot::Command::chdir::VERSION = '1.339'; | ||||||||||||||||||||||||||||||||
| 4 | # ABSTRACT: open a subshell in a selected project | |||||||||||||||||||||||||||||||||
| 5 | 16 | ▶ | use 5.014; | |||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| ||||||||||||||||||||||||||||||||||
| 6 | ||||||||||||||||||||||||||||||||||
| 7 | 16 | ▶ | use App::GitGot -command; | |||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| ||||||||||||||||||||||||||||||||||
| 8 | ||||||||||||||||||||||||||||||||||
| 9 | 16 | ▶ | use Moo; | |||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| ||||||||||||||||||||||||||||||||||
| 10 | 16 | extends 'App::GitGot::Command'; | ||||||||||||||||||||||||||||||||
| 11 | 16 | ▶ | use namespace::autoclean; | |||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| ||||||||||||||||||||||||||||||||||
| 12 | ||||||||||||||||||||||||||||||||||
| 13 | 44 | ▶ | sub command_names { qw/ chdir cd / } | |||||||||||||||||||||||||||||||
|
Subroutine
command_names: called CC=1 SCAR=0.0
Pod
documented
| ||||||||||||||||||||||||||||||||||
| 14 | ||||||||||||||||||||||||||||||||||
| 15 | 2 | ▶ | sub _execute { | |||||||||||||||||||||||||||||||
|
Subroutine
_execute: called CC=5 SCAR=18.0
| ||||||||||||||||||||||||||||||||||
| 16 | 2 | my( $self, $opt, $args ) = @_; | ||||||||||||||||||||||||||||||||
| 17 | ||||||||||||||||||||||||||||||||||
| 18 | 2 | ▶ | unless ( $self->active_repos and $self->active_repos == 1 ) { | |||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$self->active_repos and $self->active_repos == 1
MC/DC50%1/2
$self->active_repos and $self->active_repos == 1
$self->active_repos
$self->active_repos == 1
Truth table66%2/3
A and B
A= $self->active_reposB= $self->active_repos == 1
| ||||||||||||||||||||||||||||||||||
| 19 | 1 | say STDERR 'ERROR: You need to select a single repo'; | ||||||||||||||||||||||||||||||||
| 20 | 1 | exit(1); | ||||||||||||||||||||||||||||||||
| 21 | } | |||||||||||||||||||||||||||||||||
| 22 | ||||||||||||||||||||||||||||||||||
| 23 | 1 | my( $repo ) = $self->active_repos; | ||||||||||||||||||||||||||||||||
| 24 | ||||||||||||||||||||||||||||||||||
| 25 | 1 | ▶ | chdir $repo->path | |||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
chdir $repo->path || say(STDERR "ERROR: Failed to chdir to repo ($!)") && exit 1
say STDERR "ERROR: Failed to chdir to repo ($!)" and exit 1
MC/DC0%0/2
chdir $repo->path || say(STDERR "ERROR: Failed to chdir to repo ($!)") && exit 1
chdir $repo->path
say STDERR "ERROR: Failed to chdir to repo ($!)"
Truth table33%1/3
A || B
A= chdir $repo->pathB= say STDERR "ERROR: Failed to chdir to repo ($!)"
| ||||||||||||||||||||||||||||||||||
| 26 | or say STDERR "ERROR: Failed to chdir to repo ($!)" and exit(1); | |||||||||||||||||||||||||||||||||
| 27 | ||||||||||||||||||||||||||||||||||
| 28 | 0 | exec $ENV{SHELL}; | ||||||||||||||||||||||||||||||||
| 29 | } | |||||||||||||||||||||||||||||||||
| 30 | ||||||||||||||||||||||||||||||||||
| 31 | 16 | 1; | ||||||||||||||||||||||||||||||||
| 32 | ||||||||||||||||||||||||||||||||||
| 33 | ### FIXME docs | |||||||||||||||||||||||||||||||||
| 34 | ||||||||||||||||||||||||||||||||||
| 35 | __END__ | |||||||||||||||||||||||||||||||||