Created
February 28, 2011 08:15
-
-
Save thinkhy/847070 to your computer and use it in GitHub Desktop.
Clean directory with SVN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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