Dist-Zilla-BeLike-CSJEWELL

changeset 28:b1b1dfbfea54

Getting the DotFileFix plugin right.
author Curtis Jewell <csjewell@cpan.org>
date Fri Aug 13 16:12:06 2010 -0600 (2010-08-13)
parents 333f2054f825
children 919637a1a76b
files lib/Dist/Zilla/Plugin/CSJEWELL/DotFileFix.pm
line diff
     1.1 --- a/lib/Dist/Zilla/Plugin/CSJEWELL/DotFileFix.pm	Fri Aug 13 13:50:18 2010 -0600
     1.2 +++ b/lib/Dist/Zilla/Plugin/CSJEWELL/DotFileFix.pm	Fri Aug 13 16:12:06 2010 -0600
     1.3 @@ -2,6 +2,8 @@
     1.4  
     1.5  use 5.008003;
     1.6  use Moose;
     1.7 +use File::Copy qw( move );
     1.8 +use English qw( -no_match_vars );
     1.9  with 'Dist::Zilla::Role::AfterMint';
    1.10  
    1.11  our $VERSION = '0.900';
    1.12 @@ -13,12 +15,14 @@
    1.13  
    1.14  	my $root = $hash->{mint_root};
    1.15  
    1.16 -	rename $root->file('_hgignore')->stringify(),
    1.17 -	  $root->file('.hgignore')->stringify()
    1.18 -	  or $self->log('Could not rename _hgignore to .hgignore');
    1.19 +	my $source_file = $root->file('_hgignore')->stringify();
    1.20 +	my $dest_file   = $root->file('.hgignore')->stringify();
    1.21 +
    1.22 +	move( $source_file, $dest_file )
    1.23 +	  or $self->log("Could not move _hgignore to .hgignore: $OS_ERROR");
    1.24  
    1.25  	return 1;
    1.26 -}
    1.27 +} ## end sub after_mint
    1.28  
    1.29  __PACKAGE__->meta()->make_immutable();
    1.30  no Moose;