MCPcopy Create free account
hub / github.com/code-forge-io/Remix-Forge / tryReadFile

Function tryReadFile

src/utils/file.ts:280–288  ·  view source on GitHub ↗
(filePath: string | vscode.Uri)

Source from the content-addressed store, hash-verified

278 * @returns Returns the file content as a string or null if the file does not exist
279 */
280export const tryReadFile = async (filePath: string | vscode.Uri) => {
281 const location = typeof filePath === "string" ? vscode.Uri.file(filePath) : filePath;
282 try {
283 const fileContent = await vscode.workspace.fs.readFile(location);
284 return fileContent.toString();
285 } catch (e) {
286 return null;
287 }
288};
289/**
290 * Gets the file content of the provided file path
291 * @param filePath File path to read

Callers 6

generateShadcnUIFunction · 0.90
initShadcnUiFunction · 0.90
startDevToolsFunction · 0.90
generateTestFileFunction · 0.90
findTestFileFunction · 0.70
isTSConfigExistsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected