Skip to content

Commit

Permalink
Add Run::AfterMint plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rwstauner committed Jan 19, 2013
1 parent 8981992 commit b567679
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Changes
Expand Up @@ -2,6 +2,8 @@ Revision history for {{$dist->name}}

{{$NEXT}}

- Add Run::AfterMint plugin for running commands after making a new dist.

0.013 2011-11-09 06:23:08 America/Phoenix

- Fix Pod spelling error pointed out by Debian Perl Group (rt-72278).
Expand Down
2 changes: 1 addition & 1 deletion lib/Dist/Zilla/Plugin/Run.pm
Expand Up @@ -31,7 +31,7 @@ for passing as arguments to the specified commands
=for :list
* C<%a> the archive of the release (available to all C<*Release> phases)
* C<%d> the directory in which the dist was built (not in C<BeforeBuild>)
* C<%d> the directory in which the dist was built (or minted) (not in C<BeforeBuild>)
* C<%n> the dist name
* C<%p> path separator ('/' on Unix, '\\' on Win32... useful for cross-platform dist.ini files)
* C<%v> the dist version
Expand Down
38 changes: 38 additions & 0 deletions lib/Dist/Zilla/Plugin/Run/AfterMint.pm
@@ -0,0 +1,38 @@
use strict;
use warnings;

package Dist::Zilla::Plugin::Run::AfterMint;
# ABSTRACT: Execute a command after a new dist is minted
use Moose;
with qw(
Dist::Zilla::Role::AfterMint
Dist::Zilla::Plugin::Run::Role::Runner
);

use namespace::autoclean;

sub after_mint {
my ($self, $param) = @_;
$self->call_script({
dir => $param->{mint_root},
minting => 1,
});
}

=head1 SYNOPSIS
[Run::AfterMint]
run = some command %d
=head1 DESCRIPTION
This plugin executes the specified command after minting a new dist.
=head1 CONVERSIONS
See L<Dist::Zilla::Plugin::Run/CONVERSIONS>
for the list of common formatting variables available to all plugins.
=cut

1;

0 comments on commit b567679

Please sign in to comment.