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.336'; |
4
|
|
|
|
|
|
|
# ABSTRACT: open a subshell in a selected project |
5
|
15
|
|
|
15
|
|
132683
|
use 5.014; |
|
15
|
|
|
|
|
63
|
|
6
|
|
|
|
|
|
|
|
7
|
15
|
|
|
15
|
|
84
|
use App::GitGot -command; |
|
15
|
|
|
|
|
43
|
|
|
15
|
|
|
|
|
145
|
|
8
|
|
|
|
|
|
|
|
9
|
15
|
|
|
15
|
|
4827
|
use Moo; |
|
15
|
|
|
|
|
43
|
|
|
15
|
|
|
|
|
131
|
|
10
|
|
|
|
|
|
|
extends 'App::GitGot::Command'; |
11
|
15
|
|
|
15
|
|
4269
|
use namespace::autoclean; |
|
15
|
|
|
|
|
36
|
|
|
15
|
|
|
|
|
135
|
|
12
|
|
|
|
|
|
|
|
13
|
44
|
|
|
44
|
1
|
354182
|
sub command_names { qw/ chdir cd / } |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _execute { |
16
|
2
|
|
|
2
|
|
5
|
my( $self, $opt, $args ) = @_; |
17
|
|
|
|
|
|
|
|
18
|
2
|
100
|
66
|
|
|
35
|
unless ( $self->active_repos and $self->active_repos == 1 ) { |
19
|
1
|
|
|
|
|
222
|
say STDERR 'ERROR: You need to select a single repo'; |
20
|
1
|
|
|
|
|
29
|
exit(1); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
117
|
my( $repo ) = $self->active_repos; |
24
|
|
|
|
|
|
|
|
25
|
1
|
50
|
33
|
|
|
76
|
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__ |