From 57bdc4d0c6b1760d80bac2af9ab44c7d2593a1ee Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Sat, 13 Jul 2024 16:31:02 +0800 Subject: [PATCH] remove msft temp files --- src/misc.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/misc.ts b/src/misc.ts index ad78ed8..a0faba2 100644 --- a/src/misc.ts +++ b/src/misc.ts @@ -467,6 +467,21 @@ export const isSpecialFolderNameToSkip = ( return true; } } + + // microsoft tmp files... + const p = x.split("/"); + if (p.length > 0) { + const f = p[p.length - 1]; // file name + if (f.startsWith("~$")) { + const suffixList = ["doc", "docx", "ppt", "pptx", "xls", "xlsx"]; + for (const suffix of suffixList) { + if (f.endsWith(`.${suffix}`)) { + return true; + } + } + } + } + return false; };