From 8f91a54027ceec866a7c7ee521f59178446a5db1 Mon Sep 17 00:00:00 2001 From: abose Date: Mon, 9 Sep 2024 17:38:10 +0530 Subject: [PATCH] fix: remove unwanted update cleanup console error log in mac --- src/extensionsIntegrated/appUpdater/main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/extensionsIntegrated/appUpdater/main.js b/src/extensionsIntegrated/appUpdater/main.js index 4cdce42db..4cf67dc54 100644 --- a/src/extensionsIntegrated/appUpdater/main.js +++ b/src/extensionsIntegrated/appUpdater/main.js @@ -421,14 +421,16 @@ define(function (require, exports, module) { window.fs.getTauriPlatformPath(entries[0].fullPath)); } - function _cleanExtractedFolderSilent() { + function _cleanExtractedFolderSilent(logError) { return new Promise(resolve=>{ const appdataDir = window._tauriBootVars.appLocalDir; let extractPlatformPath = path.join(appdataDir, 'installer', "extracted"); const extractedVirtualPath = window.fs.getTauriVirtualPath(extractPlatformPath); let directory = FileSystem.getDirectoryForPath(extractedVirtualPath); directory.unlinkAsync() - .catch(console.error) + .catch(err=>{ + logError && console.error(`Error cleaning up ${extractedVirtualPath}`, err); + }) .finally(resolve); }); } @@ -454,7 +456,7 @@ define(function (require, exports, module) { throw new Error("Update script exit with non-0 exit code: " + result.code); } // now remove the original .app - await _cleanExtractedFolderSilent(); + await _cleanExtractedFolderSilent(true); } let installerLocation;