Permalink
Browse files

Merge pull request #71 from duckduckgo/zaahir/better-cache-clear

clear cache with rmtree()
  • Loading branch information...
2 parents d5b18dc + a7982b9 commit 233a0e138dcd2f50c512caf3f7b5aaa3011bc869 @moollaza moollaza committed May 23, 2014
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/App/DuckPAN.pm
View
@@ -21,7 +21,7 @@ use Term::ReadLine;
use Carp;
use Encode;
use Path::Class;
-#use File::Path qw(remove_tree);
+use File::Path;
our $VERSION ||= '9.999';
@@ -177,8 +177,7 @@ sub execute {
my $cache = $self->cfg->cache_path;
if (-d $cache){
print "Clearing DuckPAN cache...";
- print `rm -r $cache/*`;
- # remove_tree($self->cfg->cache_path); #better option, not working though...
+ rmtree($cache, {keep_root => 1});
print "Done\n";
}
push @modules, 'App::DuckPAN';

0 comments on commit 233a0e1

Please sign in to comment.