Skip to content

Commit

Permalink
forcing directory removal with Path::Tiny
Browse files Browse the repository at this point in the history
  • Loading branch information
Mageia committed Feb 25, 2014
1 parent 6a39886 commit c88d9ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@
Changelog for App-Magpie

{{$NEXT}}
- forcing directory removal with Path::Tiny

2.004 2014-02-25 13:43:37+01:00 Europe/Paris
- old: set "confused" renamed to "nodiff"
Expand Down
4 changes: 2 additions & 2 deletions lib/App/Magpie/Action/FixSpec.pm
Expand Up @@ -42,7 +42,7 @@ sub run {

# extracting tarball
$self->log_debug( "removing previous BUILD directory" );
path( "BUILD" )->remove_tree;
path( "BUILD" )->remove_tree( { safe => 0 } );
$self->log_debug( "extracting tarball" );
$self->run_command( "bm -lp" ); # first just extract tarball
my $distdir = path( glob "BUILD/*" );
Expand Down Expand Up @@ -74,7 +74,7 @@ sub run {
}

$self->log_debug( "generating MYMETA" );
path( "BUILD" )->remove_tree;
path( "BUILD" )->remove_tree( { safe => 0 } );
$self->run_command( "bm -lc" ); # run -c to make sure MYMETA is generated
$distdir = path( glob "BUILD/*" );
my $metafile;
Expand Down
4 changes: 2 additions & 2 deletions lib/App/Magpie/Action/WebStatic.pm
Expand Up @@ -78,7 +78,7 @@ sub run {
$self->log( "** creating web site" );
$opts->{directory} =~ s!/$!!;
my $dir = path( $opts->{directory} . ".new" );
$dir->remove_tree; $dir->mkpath;
$dir->remove_tree( { safe => 0 } ); $dir->mkpath;

# images
$self->log_debug( "images:" );
Expand Down Expand Up @@ -123,7 +123,7 @@ sub run {
# update website in one pass: remove previous version, replace it by new one
$self->log( "** updating web site" );
my $olddir = path( $opts->{directory} );
$olddir->remove_tree;
$olddir->remove_tree( { safe => 0 } );
move( $dir->stringify, $olddir->stringify );
}

Expand Down

0 comments on commit c88d9ba

Please sign in to comment.