Pi66

merodi
A markdown-based static site generator.
git clone https://git.pi66.xyz/merodi

← back to log

feat: skip dotfiles during build

author: pi66
date: 2026-07-14 19:52
hash: d481a9c1225a3cfc600aacfbb1fe7b8e2ba77e17

Diffstat:

M

src/fileops.py
5 ++++++++++++++++++++++++------
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
diff --git a/src/fileops.py b/src/fileops.py
index b17831d..59ee1c2 100644
--- a/src/fileops.py
+++ b/src/fileops.py
@@ -1,6 +1,9 @@
-from os import makedirs, path
+from os import makedirs, path, sep
 from .modules import Tree

+def is_dotfile(file_path):
+    return any(part.startswith(".") for part in path.normpath(file_path).split(sep))
+
 def write_file(file_path: str, file_content: str) -> None:
     with open(file_path, "w") as f:
         f.write(file_content)