🐛 Fix(custom): fix file delete bug

This commit is contained in:
Kuingsmile
2024-12-17 16:11:45 +08:00
parent 3efd2c2dd1
commit e2e802b30f
+2 -2
View File
@@ -141,7 +141,7 @@ class Uploader {
logger.error(e) logger.error(e)
return false return false
} finally { } finally {
if (imgPath) { if (imgPath && imgPath.startsWith(path.join(picgo.baseDir, CLIPBOARD_IMAGE_FOLDER))) {
fs.remove(imgPath) fs.remove(imgPath)
} }
} }
@@ -157,7 +157,7 @@ class Uploader {
logger.error(e) logger.error(e)
return false return false
} finally { } finally {
if (imgPath) { if (imgPath && imgPath.startsWith(path.join(picgo.baseDir, CLIPBOARD_IMAGE_FOLDER))) {
fs.remove(imgPath) fs.remove(imgPath)
} }
} }