App-PFT

 view release on metacpan or  search on metacpan

bin/pft-clean  view on Meta::CPAN

=head1 NAME

pft clean - Clean the build directory

=head1 SYNOPSIS

B<pft> B<clean> [B<-v>]

=head1 DESCRIPTION

Syntactic sugar for a plain removal of the C<ROOT/build> directory

=head1 OPTIONS

=over

=item --verbose | -v

Be verbose.

=item --help | -h

Show this help text.

=back

=cut

use v5.16;
use strict;
use warnings;
use utf8;

use Encode;
use Encode::Locale;
use File::Path;

use Getopt::Long;
Getopt::Long::Configure ("bundling");

use App::PFT;
use PFT::Tree;

my $verbose = 0;
GetOptions(
    'verbose|v' => \$verbose,
    'help|h' => sub {
        pod2usage
            -exitval => 1,
            -verbose => 2,
            -input => App::PFT::help_of 'clean',
    }
) or exit 1;

my $tree = eval{ PFT::Tree->new } || do {
    say STDERR $@ =~ s/ at.*$//rs;
    exit 1
};

File::Path::rmtree
    encode(locale_fs => $tree->dir_build),
    { verbose => $verbose }
;



( run in 1.010 second using v1.01-cache-2.11-cpan-ceb78f64989 )