From 2c62984b310cdc6c6eb475fe874f020351a9ed77 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Mon, 2 Jun 2025 13:25:48 +0300 Subject: [PATCH] Do not dive into ignored directories --- swg | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/swg b/swg index 6a940f7..7b6ddb7 100755 --- 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"; -- 2.48.1