From 46b82e41792e91f5ec77106da29881736edf547f Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Thu, 22 Feb 2024 14:59:03 -0800 Subject: [PATCH] skip over hidden folders and files in the library browser --- lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm b/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm index 1089ede307..e874383a43 100644 --- a/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm +++ b/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm @@ -85,7 +85,7 @@ sub get_library_sets ($c, $top, $dir) { } return (0) if grep {/^=library-ignore$/} @lis; - my @pgfiles = grep { m/\.pg$/ && (!m/(Header|-text)(File)?\.pg$/) && -f "$dir/$_" } @lis; + my @pgfiles = grep { m/^[^.].*\.pg$/ && (!m/(Header|-text)(File)?\.pg$/) && -f "$dir/$_" } @lis; my $pgcount = scalar(@pgfiles); my $pgname = $dir; $pgname =~ s!.*/!!; @@ -94,6 +94,8 @@ sub get_library_sets ($c, $top, $dir) { my @pgdirs; my @dirs = grep { !$ignoredir{$_} && -d "$dir/$_" } @lis; + # Filter out hidden directories + @dirs = grep { $_ !~ /^\./ } @dirs; if ($top == 1) { @dirs = grep { !$c->{problibs}{$_} } @dirs; }