Skip to content

Commit

Permalink
Use Config.pm to sterilize
Browse files Browse the repository at this point in the history
  • Loading branch information
kentfredric committed Oct 23, 2013
1 parent 26963a4 commit c331916
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions sterilize_env.pl
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ sub safe_exec {
diag('Is not running under travis!');
exit 1;
}
for my $i (@INC) {
next if $i !~ /site/;
next if $i eq '.';
diag( 'Sterilizing files in ' . $i );
safe_exec( 'find', $i, '-type', 'f', '-delete' );
diag( 'Sterilizing dirs in ' . $i );
safe_exec( 'find', $i, '-depth', '-type', 'd', '-delete' );
use Config;
for my $libdir ( grep { $_ =~ /site(lib|arch)exp$/ } keys %Config ) {
safe_exec( 'find', $libdir, '-type', 'f', '-delete' );
safe_exec( 'find', $libdir, '-depth', '-type', 'd', '-delete' );
}

0 comments on commit c331916

Please sign in to comment.