Skip to content

Commit d3ec9a5

Browse files
authored
fix: allow dot files with --package-suffixes (#1742)
* allow files that start with . to be added via --package-suffixes * fix so not all hidden files are included
1 parent c90a71b commit d3ec9a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

metaflow/package.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ def _walk(self, root, exclude_hidden=True, suffixes=None):
8888
# if path and (path[0] == '.' or './' in path):
8989
# continue
9090
for fname in files:
91-
if fname[0] == ".":
92-
continue
93-
if any(fname.endswith(suffix) for suffix in suffixes):
91+
if (fname[0] == "." and fname in suffixes) or (
92+
fname[0] != "."
93+
and any(fname.endswith(suffix) for suffix in suffixes)
94+
):
9495
p = os.path.join(path, fname)
9596
yield p, p[prefixlen:]
9697

0 commit comments

Comments
 (0)