Skip to content

Instantly share code, notes, and snippets.

@thinkhy
Created February 28, 2011 08:15
Show Gist options
  • Save thinkhy/847070 to your computer and use it in GitHub Desktop.
Save thinkhy/847070 to your computer and use it in GitHub Desktop.
Clean directory with SVN
#!/usr/bin/perl
use File::Path;
use strict;
use warnings;
my @tree=<*>;
foreach (@tree){
&if_a_tree($_);
}
sub if_a_tree{
if(-d
&& $_ ne "."
&& $_ ne ".."){
print "$_ is a directory\n";
if ($_ eq ".svn")
{
rmtree $_;
return;
}
chdir $_;
my @tree=<* .*>;
foreach(@tree){
&if_a_tree($_);
}
chdir "..";
}
if(-f){
print "$_ just a file\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment