]> Sergey Matveev's repositories - swg.git/commitdiff
Do not dive into ignored directories
authorSergey Matveev <stargrave@stargrave.org>
Mon, 2 Jun 2025 10:25:48 +0000 (13:25 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 2 Jun 2025 10:25:48 +0000 (13:25 +0300)
swg

diff --git a/swg b/swg
index 6a940f7f6511667e38c0d78b916ac9175cd0ddb3..7b6ddb70c16d6668c17607dc9b1c4d647d77736b 100755 (executable)
--- a/swg
+++ b/swg
@@ -69,13 +69,19 @@ use File::Basename;
         $pth = decode q{UTF-8}, $File::Find::name;
         $pth =~ s/^[.]\/?//;
         foreach (split /\//, $pth) {
-            return if (/^[.]/);
+            if (/^[.]/) {
+                $File::Find::prune = 1;
+                return;
+            }
         }
         if (-d $fn) {
             $pth .= q{/};
         }
         foreach (@ignores) {
-            return if $pth =~ /$_/;
+            if ($pth =~ /$_/) {
+                $File::Find::prune = 1;
+                return;
+            }
         }
         if ($ARGV[0] eq q{files}) {
             print "$pth\n";