Skip to content

Commit

Permalink
Make sterilize env respond to more ENV variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kentfredric committed Sep 21, 2013
1 parent 1a977e3 commit 746ad1c
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions sterilize_env.pl
Expand Up @@ -3,15 +3,29 @@
use warnings;
use utf8;

sub diag {
print STDERR @_;
print STDERR "\n";
}

if ( not exists $ENV{STERILIZE_ENV} ) {
diag('STERILIZE_ENV unset');
exit 0;
}
if ( $ENV{STERILIZE_ENV} < 1 ) {
diag('STERLIZIE_ENV < 1, Not Sterilizing');
exit 0;
}
if ( not exists $ENV{TRAVIS} ) {
die "Is not travis!";
diag('Is not running under travis!');
exit 1;
}
for my $i (@INC) {
next if $i !~ /site/;
next if $i eq '.';

# printf "%s\n", $i;
diag( 'Sterilizing files in ' . $i );
system( 'find', $i, '-type', 'f', '-delete' );
diag( 'Sterilizing dirs in ' . $i );
system( 'find', $i, '-depth', '-type', 'd', '-delete' );
}

0 comments on commit 746ad1c

Please sign in to comment.