2024-07-14 18:03:42,220 ERROR blag.devserver Error occurred during rebuild:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/blag/devserver.py", line 80, in autoreload
mtime = get_last_modified(dirs)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/blag/devserver.py", line 45, in get_last_modified
mtime = os.stat(os.path.join(root, f)).st_mtime
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'content/.#survey.md'
2024-07-14 18:03:42,221 INFO blag.devserver Devserver did not crash, you may continue editing.
diff --git a/blag/blag.py b/blag/blag.py
index ed6db15..c538a5c 100644
--- a/blag/blag.py
+++ b/blag/blag.py
@@ -217,6 +217,9 @@ def build(args: argparse.Namespace) -> None:
convertibles = []
for root, dirnames, filenames in os.walk(args.input_dir):
for filename in filenames:
+ if filename.startswith(".") or filename.endswith("~"):
+ logger.debug(f"Skipping {filename}...")
+ continue
rel_src = os.path.relpath(
f"{root}/{filename}", start=args.input_dir
)
diff --git a/blag/devserver.py b/blag/devserver.py
index 1945740..076b7f9 100644
--- a/blag/devserver.py
+++ b/blag/devserver.py
@@ -42,6 +42,9 @@ def get_last_modified(dirs: list[str]) -> float:
for dir in dirs:
for root, dirs, files in os.walk(dir):
for f in files:
+ if f.startswith(".") or f.endswith("~"):
+ logger.debug(f"Skipping {f} ...")
+ continue
mtime = os.stat(os.path.join(root, f)).st_mtime
if mtime > last_mtime:
last_mtime = mtime
worked for me.