🐛 fix prompt file loading bug

This commit is contained in:
Nate Sesti 2024-05-20 08:40:04 -07:00
parent a533668a26
commit 06da0caf28

View file

@ -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(