aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-04-28 20:28:40 +0200
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-04-28 20:28:40 +0200
commit613322b4a677032d82596985b3995027cc1991ba (patch)
tree575f9895cf383992fbc126ab84b03a2915a5e328
parent30065a240f6f58cb7e7d4f5663402b40c07b8aef (diff)
downloadsbotools2-613322b4a677032d82596985b3995027cc1991ba.tar.xz
sboclean: Change dir check into an actual if
-rwxr-xr-xsboclean5
1 files changed, 4 insertions, 1 deletions
diff --git a/sboclean b/sboclean
index 2f51f35..3b7792e 100755
--- a/sboclean
+++ b/sboclean
@@ -71,7 +71,10 @@ sub rm_full {
sub remove_stuff {
script_error 'remove_stuff requires an argument.' unless @_ == 1;
my $dir = shift;
- -d $dir or say 'Nothing to do.' and return 0;
+ if (not -d $dir) {
+ say 'Nothing to do.';
+ return 0;
+ }
opendir(my $dh, $dir);
FIRST: while (my $ls = readdir $dh) {
next FIRST if in($ls => qw/ . .. /);