Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: a2d566648e
Fetching contributors…

Cannot retrieve contributors at this time

executable file 50 lines (41 sloc) 1.043 kB
#!/usr/bin/perl
use strict;
use vars qw($VERSION);
my $APP = 'unrarec';
$VERSION = '0.002';
use Data::Dumper;
{
package Data::Dumper;
no strict 'vars';
$Terse = $Indent = $Useqq = $Deparse = $Sortkeys = 1;
$Quotekeys = 0;
}
use Cwd qw(getcwd);
#use Data::Printer;
use File::Find::Rule;
use File::Spec;
my $start_path = File::Spec->rel2abs(shift);
my $old_path = getcwd();
#chdir($start_path) or die $!;
my $dirs = { };
map { s{(.*)/.+[.]rar$}{$1}; $dirs->{$_}=1;} File::Find::Rule->file()
->name('*.rar')
->in($start_path);
print Dumper $dirs, "\n-\n";
print "\e[1mDescend\e[m? [Y/n] ";
chomp(my $response = <>);
if(lc($response) ne 'y') {
die "Bailing out...\n";
}
for my $d(sort(keys(%$dirs))) {
chdir $d or die "chdir $d: $!\n";
warn "chdir $d\n";
system('unrar', 'x', '-o-', '*.rar');
}
chdir $old_path or warn "chdir $old_path: $!\n";
BEGIN {
printf "\e[?7t"
}
END {
printf "\e[?7t"
}
Jump to Line
Something went wrong with that request. Please try again.