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