🐛 fix prompt file loading bug
This commit is contained in:
parent
a533668a26
commit
06da0caf28
1 changed files with 11 additions and 6 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue