mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-11 17:13:59 +00:00
follow symlink
This commit is contained in:
@@ -31,7 +31,7 @@ class FTreeDir:
|
|||||||
ignore empty directory
|
ignore empty directory
|
||||||
test for ignore pattern
|
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:
|
for file in files:
|
||||||
fpath = os.path.join(root, file)
|
fpath = os.path.join(root, file)
|
||||||
if must_ignore([fpath], ignores=self.ignores,
|
if must_ignore([fpath], ignores=self.ignores,
|
||||||
@@ -43,6 +43,10 @@ class FTreeDir:
|
|||||||
if len(os.listdir(dpath)) < 1:
|
if len(os.listdir(dpath)) < 1:
|
||||||
# ignore empty directory
|
# ignore empty directory
|
||||||
continue
|
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,
|
if must_ignore([dpath], ignores=self.ignores,
|
||||||
debug=self.debug, strict=True):
|
debug=self.debug, strict=True):
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user