Dist-Zilla-Plugin-Git
view release on metacpan or search on metacpan
lib/Dist/Zilla/Plugin/Git/CommitBuild.pm view on Meta::CPAN
my $target_branch = _format_branch( $branch, $self );
for my $file ( @{ $self->zilla->files } ) {
my ( $name, $content ) = ( $file->name, (Dist::Zilla->VERSION < 5
? $file->content
: $file->encoded_content) );
my ( $outfile ) = $dir->child( $name );
$outfile->parent->mkpath();
$outfile->spew_raw( $content );
chmod $file->mode, "$outfile" or die "couldn't chmod $outfile: $!";
}
# returns the sha1 of the created tree object
my $tree = $self->_create_tree($src, $dir);
my ($last_build_tree) = try { $src->rev_parse("$target_branch^{tree}") };
$last_build_tree ||= 'none';
### $last_build_tree
if ($tree eq $last_build_tree) {
t/lib/Dist/Zilla/Plugin/MyTestArchiver.pm view on Meta::CPAN
package Dist::Zilla::Plugin::MyTestArchiver;
use Moose;
use Path::Tiny qw(path);
use File::Copy ();
with 'Dist::Zilla::Role::Releaser';
sub release {
my ($self, $tgz) = @_;
chmod(0444, $tgz);
my $dir = 'releases';
mkdir $dir or $self->log_fatal( "Unable to create directory $dir: $!" );
my $dest = path( $dir )->child($tgz->basename);
File::Copy::move($tgz, $dest) or $self->log_fatal( "Unable to move: $!" );
$self->log("Moved $tgz to $dest");
}
1;
( run in 0.241 second using v1.01-cache-2.11-cpan-8d75d55dd25 )