Prevent user trying to run dirs on "/"

This commit is contained in:
Fred Boniface 2023-10-02 22:35:14 +01:00
parent 7bd658ab1a
commit 66e45b675c

4
dirs
View File

@ -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 {