Skip to content

Commit

Permalink
fix: allow dot files with --package-suffixes (#1742)
Browse files Browse the repository at this point in the history
* allow files that start with . to be added via --package-suffixes

* fix so not all hidden files are included
  • Loading branch information
saikonen authored Feb 29, 2024
1 parent c90a71b commit d3ec9a5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions metaflow/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ def _walk(self, root, exclude_hidden=True, suffixes=None):
# if path and (path[0] == '.' or './' in path):
# continue
for fname in files:
if fname[0] == ".":
continue
if any(fname.endswith(suffix) for suffix in suffixes):
if (fname[0] == "." and fname in suffixes) or (
fname[0] != "."
and any(fname.endswith(suffix) for suffix in suffixes)
):
p = os.path.join(path, fname)
yield p, p[prefixlen:]

Expand Down

0 comments on commit d3ec9a5

Please sign in to comment.