delete macOS specific files

This commit is contained in:
jonaswinkler
2021-05-19 20:02:47 +02:00
parent f8afbae2cd
commit 93a79be1e2
2 changed files with 25 additions and 0 deletions

View File

@@ -333,6 +333,12 @@ class Consumer(LoggingMixin):
self.log("debug", "Deleting file {}".format(self.path))
os.unlink(self.path)
# https://github.com/jonaswinkler/paperless-ng/discussions/1037
shadow_file = os.path.join(os.path.dirname(self.path), "._" + os.path.basename(self.path))
if os.path.isfile(shadow_file):
self.log("debug", "Deleting file {}".format(shadow_file))
os.unlink(shadow_file)
except Exception as e:
self._fail(
str(e),