From c50a0058b38f7ec9f7bc47df3250547fc472025e Mon Sep 17 00:00:00 2001 From: ABevier Date: Fri, 5 May 2023 22:56:42 -0400 Subject: [PATCH] do not error on fresh installs (#568) --- modules/desktop/electron/libs/tea-dir.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/desktop/electron/libs/tea-dir.ts b/modules/desktop/electron/libs/tea-dir.ts index 4a8f0fd..f27e0da 100644 --- a/modules/desktop/electron/libs/tea-dir.ts +++ b/modules/desktop/electron/libs/tea-dir.ts @@ -30,6 +30,12 @@ export const getGuiPath = () => { export async function getInstalledPackages(): Promise { const pkgsPath = getTeaPath(); + + if (!fs.existsSync(pkgsPath)) { + log.info(`packages path ${pkgsPath} does not exist, no installed packages`); + return []; + } + log.info("recursively reading:", pkgsPath); const folders = await deepReadDir({ dir: pkgsPath,