diff options
| author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-04-28 20:28:40 +0200 | 
|---|---|---|
| committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-04-28 20:28:40 +0200 | 
| commit | 613322b4a677032d82596985b3995027cc1991ba (patch) | |
| tree | 575f9895cf383992fbc126ab84b03a2915a5e328 | |
| parent | 30065a240f6f58cb7e7d4f5663402b40c07b8aef (diff) | |
| download | sbotools2-613322b4a677032d82596985b3995027cc1991ba.tar.xz | |
sboclean: Change dir check into an actual if
| -rwxr-xr-x | sboclean | 5 | 
1 files changed, 4 insertions, 1 deletions
@@ -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/ . .. /);  | 
