Prevent user trying to run dirs on "/"
This commit is contained in:
parent
7bd658ab1a
commit
66e45b675c
4
dirs
4
dirs
@ -35,6 +35,10 @@ unless (-d $dir_path) {
|
|||||||
die "$dir_path is not a directory\n"
|
die "$dir_path is not a directory\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($dir_path eq '/') {
|
||||||
|
die "You are not able to run 'dirs' on the root directory\n"
|
||||||
|
}
|
||||||
|
|
||||||
my $total_size = 0;
|
my $total_size = 0;
|
||||||
|
|
||||||
sub calculate_size {
|
sub calculate_size {
|
||||||
|
Loading…
Reference in New Issue
Block a user