line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Setup::Plugin::VC::Git; |
2
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
87
|
|
3
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
73
|
|
4
|
2
|
|
|
2
|
|
13
|
use base 'Module::Setup::Plugin'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
798
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub register { |
7
|
8
|
|
|
8
|
0
|
23
|
my($self, ) = @_; |
8
|
8
|
|
|
|
|
55
|
$self->add_trigger( check_skeleton_directory => \&check_skeleton_directory ); |
9
|
8
|
|
|
7
|
|
322
|
$self->add_trigger( append_template_file => sub { $self->append_template_file(@_) } ); |
|
7
|
|
|
|
|
227
|
|
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub check_skeleton_directory { |
13
|
7
|
|
|
7
|
1
|
162
|
my $self = shift; |
14
|
7
|
100
|
|
|
|
28
|
return unless $self->dialog("Git init? [Yn] ", 'y') =~ /[Yy]/; |
15
|
|
|
|
|
|
|
|
16
|
5
|
100
|
|
|
|
61
|
!$self->system('git', 'init') or die $?; |
17
|
4
|
100
|
|
|
|
168606
|
!$self->system('git', 'add', '.gitignore') or die $?; |
18
|
|
|
|
|
|
|
|
19
|
3
|
|
|
|
|
16061
|
my $dir = Module::Setup::Path::Dir->new('.'); |
20
|
3
|
|
|
|
|
612
|
while (my $path = $dir->next) { |
21
|
34
|
100
|
100
|
|
|
2773
|
next if $path eq '.' || $path eq '..' || $path eq '.git'; |
|
|
|
100
|
|
|
|
|
22
|
27
|
|
|
|
|
3268
|
$self->system('git', 'add', $path); |
23
|
|
|
|
|
|
|
} |
24
|
3
|
100
|
|
|
|
337
|
!$self->system('git', 'commit', '-m', 'initial commit') or die $?; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 NAME |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Module::Setup::Plugin::VC::Git - Git plugin |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SYNOPSIS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
module-setup --init --plugin=VC::Git |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SEE ALSO |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
original L by dann |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__DATA__ |