path->uri continued
This commit is contained in:
parent
b6b3cceb78
commit
84fda7740c
2 changed files with 1 additions and 27 deletions
|
|
@ -1,25 +0,0 @@
|
|||
import { IDE } from "../..";
|
||||
import { walkDir } from "../../indexing/walkDir";
|
||||
|
||||
export async function getPromptFiles(
|
||||
ide: IDE,
|
||||
dir: string,
|
||||
): Promise<{ path: string; content: string }[]> {
|
||||
try {
|
||||
const exists = await ide.fileExists(dir);
|
||||
|
||||
if (!exists) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const paths = await walkDir(dir, ide, { ignoreFiles: [] });
|
||||
const results = paths.map(async (path) => {
|
||||
const content = await ide.readFile(path); // make a try catch
|
||||
return { path, content };
|
||||
});
|
||||
return Promise.all(results);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
import { createNewPromptFile } from "./createNewPromptFile";
|
||||
import { getPromptFilesV1 } from "./getPromptFiles";
|
||||
import { slashCommandFromPromptFile } from "./slashCommandFromPromptFile";
|
||||
|
||||
export const DEFAULT_PROMPTS_FOLDER = ".prompts";
|
||||
|
||||
export { createNewPromptFile, getPromptFilesV1, slashCommandFromPromptFile };
|
||||
export { createNewPromptFile, slashCommandFromPromptFile };
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue