File Coverage

blib/lib/Dist/Zilla/App/Command/install.pm
Criterion Covered Total %
statement 6 10 60.0
branch 0 4 0.0
condition n/a
subroutine 2 5 40.0
pod 3 3 100.0
total 11 22 50.0


line stmt bran cond sub pod time code
1             package Dist::Zilla::App::Command::install 6.037;
2             # ABSTRACT: install your dist
3              
4 4     4   3282 use Dist::Zilla::Pragmas;
  4         10  
  4         32  
5              
6 4     4   33 use Dist::Zilla::App -command;
  4         12  
  4         49  
7              
8             #pod =head1 SYNOPSIS
9             #pod
10             #pod Installs your distribution using a specified command.
11             #pod
12             #pod dzil install [--install-command="cmd"]
13             #pod
14             #pod =cut
15 0     0 1   sub abstract { 'install your dist' }
16              
17             #pod =head1 EXAMPLE
18             #pod
19             #pod $ dzil install
20             #pod $ dzil install --install-command="cpan ."
21             #pod
22             #pod =cut
23              
24             sub opt_spec {
25 0     0 1   [ 'install-command=s', 'command to run to install (e.g. "cpan .")' ],
26             [ 'keep-build-dir|keep' => 'keep the build directory even after a success' ],
27             }
28              
29             #pod =head1 OPTIONS
30             #pod
31             #pod =head2 --install-command
32             #pod
33             #pod This defines what command to run after building the dist in the dist dir.
34             #pod
35             #pod Any value that works with L<C<system>|perlfunc/system> is accepted.
36             #pod
37             #pod If not specified, calls (roughly):
38             #pod
39             #pod cpanm .
40             #pod
41             #pod For more information, look at the L<install|Dist::Zilla::Dist::Builder/install> method in
42             #pod Dist::Zilla.
43             #pod
44             #pod =cut
45              
46             sub execute {
47 0     0 1   my ($self, $opt, $arg) = @_;
48              
49 0 0         $self->zilla->install({
    0          
50             $opt->install_command
51             ? (install_command => [ $opt->install_command ])
52             : (),
53             $opt->keep_build_dir
54             ? (keep_build_dir => 1)
55             : (),
56             });
57             }
58              
59             1;
60              
61             __END__
62              
63             =pod
64              
65             =encoding UTF-8
66              
67             =head1 NAME
68              
69             Dist::Zilla::App::Command::install - install your dist
70              
71             =head1 VERSION
72              
73             version 6.037
74              
75             =head1 SYNOPSIS
76              
77             Installs your distribution using a specified command.
78              
79             dzil install [--install-command="cmd"]
80              
81             =head1 PERL VERSION
82              
83             This module should work on any version of perl still receiving updates from
84             the Perl 5 Porters. This means it should work on any version of perl
85             released in the last two to three years. (That is, if the most recently
86             released version is v5.40, then this module should work on both v5.40 and
87             v5.38.)
88              
89             Although it may work on older versions of perl, no guarantee is made that the
90             minimum required version will not be increased. The version may be increased
91             for any reason, and there is no promise that patches will be accepted to
92             lower the minimum required perl.
93              
94             =head1 EXAMPLE
95              
96             $ dzil install
97             $ dzil install --install-command="cpan ."
98              
99             =head1 OPTIONS
100              
101             =head2 --install-command
102              
103             This defines what command to run after building the dist in the dist dir.
104              
105             Any value that works with L<C<system>|perlfunc/system> is accepted.
106              
107             If not specified, calls (roughly):
108              
109             cpanm .
110              
111             For more information, look at the L<install|Dist::Zilla::Dist::Builder/install> method in
112             Dist::Zilla.
113              
114             =head1 AUTHOR
115              
116             Ricardo SIGNES 😏 <cpan@semiotic.systems>
117              
118             =head1 COPYRIGHT AND LICENSE
119              
120             This software is copyright (c) 2026 by Ricardo SIGNES.
121              
122             This is free software; you can redistribute it and/or modify it under
123             the same terms as the Perl 5 programming language system itself.
124              
125             =cut