From 06da0caf2803de5b3b2fc4fdad820ea77d9dda4c Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 20 May 2024 08:40:04 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20prompt=20file=20loading=20?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/config/promptFile.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/core/config/promptFile.ts b/core/config/promptFile.ts index 7ebd94435..494220b6a 100644 --- a/core/config/promptFile.ts +++ b/core/config/promptFile.ts @@ -8,12 +8,17 @@ export async function getPromptFiles( ide: IDE, dir: string, ): Promise<{ path: string; content: string }[]> { - const paths = await ide.listWorkspaceContents(dir); - const results = paths.map(async (path) => { - const content = await ide.readFile(path); - return { path, content }; - }); - return Promise.all(results); + try { + const paths = await ide.listWorkspaceContents(dir); + const results = paths.map(async (path) => { + const content = await ide.readFile(path); + return { path, content }; + }); + return Promise.all(results); + } catch (e) { + console.error(e); + return []; + } } export function slashCommandFromPromptFile(