From 84fda7740c868d78eb84cb2a44d2d05e56d7de9a Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 10 Dec 2024 18:18:20 -0800 Subject: [PATCH] path->uri continued --- core/promptFiles/v1/getPromptFiles.ts | 25 ------------------------- core/promptFiles/v1/index.ts | 3 +-- 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 core/promptFiles/v1/getPromptFiles.ts diff --git a/core/promptFiles/v1/getPromptFiles.ts b/core/promptFiles/v1/getPromptFiles.ts deleted file mode 100644 index b9bb5d823..000000000 --- a/core/promptFiles/v1/getPromptFiles.ts +++ /dev/null @@ -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 []; - } -} diff --git a/core/promptFiles/v1/index.ts b/core/promptFiles/v1/index.ts index e14c2103c..940403e38 100644 --- a/core/promptFiles/v1/index.ts +++ b/core/promptFiles/v1/index.ts @@ -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 };