* Perl code for git-clean
@ 2007-05-08 23:51 Randal L. Schwartz
0 siblings, 0 replies; only message in thread
From: Randal L. Schwartz @ 2007-05-08 23:51 UTC (permalink / raw)
To: git
OK, this is untested, but I usually get this stuff right
by eyeballing it. :)
export cleandir;
git-ls-files -z --others --directory $excl ${excl_info:+"$excl_info"} -- "$@" |
perl -ln0e '
use File::Path qw(rmtree);
if (-d and not -L) {
if (not $ENV{cleandir}) {
print "Not removing $_";
next;
}
print "Removing $_";
rmtree($_);
} else {
print "Removing $_";
unlink($_);
}
'
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge•com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-05-08 23:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-08 23:51 Perl code for git-clean Randal L. Schwartz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox