1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 15:39:43 +00:00

follow symlink

This commit is contained in:
deadc0de6
2024-01-28 16:59:16 +01:00
committed by deadc0de
parent 64bce278b1
commit f0f558d827

View File

@@ -31,7 +31,7 @@ class FTreeDir:
ignore empty directory
test for ignore pattern
"""
for root, dirs, files in os.walk(self.path):
for root, dirs, files in os.walk(self.path, followlinks=True):
for file in files:
fpath = os.path.join(root, file)
if must_ignore([fpath], ignores=self.ignores,
@@ -43,6 +43,10 @@ class FTreeDir:
if len(os.listdir(dpath)) < 1:
# ignore empty directory
continue
# appending "/" allows to ensure pattern
# like "*/dir/*" will match the content of the directory
# but also the directory itself
dpath += os.path.sep
if must_ignore([dpath], ignores=self.ignores,
debug=self.debug, strict=True):
continue