Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 44 lines (38 sloc) 829 Bytes
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
use Switch;
sub usage
{
print "$0 extension [path]\n";
exit
}
my $ext = shift || usage();
my $exclude;
switch ($^O)
{
case "cygwin" { $exclude = "mac"; }
case "MSWin32" { $exclude = "mac"; } # active perl
case "darwin" { $exclude = "win"; }
else { $exclude = "win"; }
}
find( \&find_sources, shift || '.' );
sub find_sources
{
if (-d)
{
switch ($_)
{
case '.svn' { $File::Find::prune = 1; }
case '_build' { $File::Find::prune = 1; }
case 'tests' { $File::Find::prune = 1; }
case ($exclude) { $File::Find::prune = 1; }
}
}
elsif (-f and /\.$ext$/)
{
$File::Find::name =~ s|^\./||g;
print "$File::Find::name\n";
}
}
Jump to Line
Something went wrong with that request. Please try again.