MCPcopy Create free account
hub / github.com/arctic-cli/interface / loadFile

Function loadFile

packages/arctic/src/config/config.ts:995–1005  ·  view source on GitHub ↗
(filepath: string)

Source from the content-addressed store, hash-verified

993 })
994
995 async function loadFile(filepath: string): Promise<Info> {
996 log.info("loading", { path: filepath })
997 let text = await Bun.file(filepath)
998 .text()
999 .catch((err) => {
1000 if (err.code === "ENOENT") return
1001 throw new JsonError({ path: filepath }, { cause: err })
1002 })
1003 if (!text) return {}
1004 return load(text, filepath)
1005 }
1006
1007 async function load(text: string, configFilepath: string) {
1008 text = text.replace(/\{env:([^}]+)\}/g, (_, varName) => {

Callers 2

config.tsFile · 0.85
updateFunction · 0.85

Calls 2

loadFunction · 0.70
textMethod · 0.65

Tested by

no test coverage detected