Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make sterilize env respond to more ENV variables

  • Loading branch information...
commit 746ad1ccb413af9be7c5b4e111c34b85635476f0 1 parent 1a977e3
Kent Fredric kentfredric authored
Showing with 17 additions and 3 deletions.
  1. +17 −3 sterilize_env.pl
20 sterilize_env.pl
View
@@ -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' );
}
Please sign in to comment.
Something went wrong with that request. Please try again.