diff --git a/src/interface/desktop/main.js b/src/interface/desktop/main.js index 55cb78a18..d41453ddc 100644 --- a/src/interface/desktop/main.js +++ b/src/interface/desktop/main.js @@ -121,17 +121,17 @@ async function isPlainTextFile(filePath) { } async function processDirectory(filesToPush, folder) { - const files = fs.readdirSync(folder.path, { withFileTypes: true, recursive: true }); + const files = fs.readdirSync(folder.path, { withFileTypes: true }); for (const file of files) { - const filePath = path.join(folder.path, file.name); + const filePath = path.join(file.path, file.name || ''); if (file.isFile() && await isPlainTextFile(filePath)) { - console.log(`Add ${file.name} in ${folder.path} for indexing`); + console.log(`Add ${file.name} in ${file.path} for indexing`); filesToPush.push(filePath); } if (file.isDirectory()) { - await processDirectory(filesToPush, {'path': path.join(folder.path, file.name)}); + await processDirectory(filesToPush, {'path': filePath}); } } } @@ -497,11 +497,11 @@ app.whenReady().then(() => { try { const result = await todesktop.autoUpdater.checkForUpdates(); if (result.updateInfo) { - console.log("Update found:", result.updateInfo.version); + console.log("Desktop app update found:", result.updateInfo.version); todesktop.autoUpdater.restartAndInstall(); } } catch (e) { - console.log("Update check failed:", e); + console.warn("Desktop app update check failed:", e); } }) diff --git a/src/interface/desktop/package.json b/src/interface/desktop/package.json index 7f57618a2..11b1bb8e9 100644 --- a/src/interface/desktop/package.json +++ b/src/interface/desktop/package.json @@ -20,7 +20,6 @@ "axios": "^1.6.4", "cron": "^2.4.3", "electron-store": "^8.1.0", - "fs": "^0.0.1-security", "file-type": "^16.2.0" } } diff --git a/src/interface/desktop/yarn.lock b/src/interface/desktop/yarn.lock index 1b599356d..7970802ce 100644 --- a/src/interface/desktop/yarn.lock +++ b/src/interface/desktop/yarn.lock @@ -536,11 +536,6 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fs@^0.0.1-security: - version "0.0.1-security" - resolved "https://registry.yarnpkg.com/fs/-/fs-0.0.1-security.tgz#8a7bd37186b6dddf3813f23858b57ecaaf5e41d4" - integrity sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w== - function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"