diff --git a/entangled/filedb.py b/entangled/filedb.py index 54a6e04..8fca783 100644 --- a/entangled/filedb.py +++ b/entangled/filedb.py @@ -166,12 +166,17 @@ def initialize() -> FileDB: db = FileDB.read() undead = list(filter(lambda p: not p.exists(), db.files)) for path in undead: - logging.warning( - "File `%s` in DB doesn't exist. Removing entry from DB.", path - ) - del db[path] - if len(undead) > 0: - db.write() + if path in db.managed: + logging.warning( + "File `%s` in DB seems not to exist, but this file is managed.\n" + "This may happen every now and then with certain editors that " + "delete a file before writing.", path + ) + else: + logging.warning( + "File `%s` is in database but doesn't seem to exist.\n" + "Run `entangled tangle -r` to recreate the database.", path + ) return db FileDB.path().parent.mkdir(parents=True, exist_ok=True) diff --git a/pyproject.toml b/pyproject.toml index 60d521f..e079b66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "entangled-cli" -version = "2.1.8" +version = "2.1.9" description = "Literate Programming toolbox" repository = "https://github.com/entangled/entangled.py" homepage = "https://entangled.github.io/"