MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / loadSettings

Function loadSettings

apps/cli/src/lib/storage/settings.ts:12–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10}
11
12export async function loadSettings(): Promise<CliSettings> {
13 try {
14 const settingsPath = getSettingsPath()
15 const data = await fs.readFile(settingsPath, "utf-8")
16 return JSON.parse(data) as CliSettings
17 } catch (error) {
18 if ((error as NodeJS.ErrnoException).code === "ENOENT") {
19 return {}
20 }
21
22 throw error
23 }
24}
25
26export async function saveSettings(settings: Partial<CliSettings>): Promise<void> {
27 const configDir = getConfigDir()

Callers 3

runFunction · 0.85
saveSettingsFunction · 0.85
settings.test.tsFile · 0.85

Calls 3

getSettingsPathFunction · 0.85
parseMethod · 0.80
readFileMethod · 0.45

Tested by

no test coverage detected