diff options
author | Jacob Pipkin <j@dawnrazor.net> | 2012-06-01 13:36:46 -0500 |
---|---|---|
committer | Jacob Pipkin <j@dawnrazor.net> | 2012-06-01 13:36:46 -0500 |
commit | 72e37ce8c8f65d1340356ffb24581857be3ebb09 (patch) | |
tree | 598a879517eedab577afa4b07abf02988282e264 | |
parent | 47267ccf2c352348d2d47ff0d91a628d09fdafa8 (diff) | |
download | sbotools2-72e37ce8c8f65d1340356ffb24581857be3ebb09.tar.xz |
bug fixes to make sboclean work
-rwxr-xr-x | sboclean | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -10,7 +10,7 @@ use SBO::Lib; use File::Basename; use Getopt::Std; -use File::Path qr(remove_tree); +use File::Path qw(remove_tree); use strict; use warnings FATAL => 'all'; @@ -51,14 +51,15 @@ sub remove_stuff { my $dir = shift; opendir (my $dh, $dir); FIRST: while (my $ls = readdir $dh) { - next if /^\.[\.]{0,1}$/; + next if $ls =~ /^\.[\.]{0,1}$/; + my $full = "$dir/$ls"; if ($interactive eq 'TRUE') { - print "Remove $ls? [yn] "; + print "Remove $full? [yn] "; my $test = <STDIN>; next FIRST unless $test =~ /^[Yy]/; } - unlink $ls if -f $ls; - remove_tree $ls if -d $ls; + unlink $full if -f $full; + remove_tree $full if -d $full; } } |