aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Ionite <[email protected]>2023-03-09 20:24:52 -0500
committerGravatar Ionite <[email protected]>2023-03-09 20:24:52 -0500
commitefc899d6f193e0cfbecf50a70642912b8e83810d (patch)
treebbca622c80fda6924df70a680d221b64f61f701d
parentMerge pull request #159 from python-discord/bytes-output (diff)
Add files output exclude for hidden paths
-rw-r--r--snekbox/memfs.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/snekbox/memfs.py b/snekbox/memfs.py
index f32fed1..ddea9a9 100644
--- a/snekbox/memfs.py
+++ b/snekbox/memfs.py
@@ -138,6 +138,11 @@ class MemFS:
"""
count = 0
for file in self.output.rglob(pattern):
+ # Ignore hidden directories or files
+ if any(part.startswith(".") for part in file.parts):
+ log.info(f"Skipping hidden path {file!s}")
+ continue
+
if exclude_files and (orig_time := exclude_files.get(file)):
new_time = file.stat().st_mtime
log.info(f"Checking {file.name} ({orig_time=}, {new_time=})")