MCPcopy Create free account
hub / github.com/tiann/hapi / readSettings

Function readSettings

cli/src/persistence.ts:64–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62}
63
64export async function readSettings(): Promise<Settings> {
65 if (!existsSync(configuration.settingsFile)) {
66 return { ...defaultSettings }
67 }
68
69 try {
70 const content = await readFile(configuration.settingsFile, 'utf8')
71 return JSON.parse(content)
72 } catch {
73 return { ...defaultSettings }
74 }
75}
76
77export async function writeSettings(settings: Settings): Promise<void> {
78 if (!existsSync(configuration.happyHomeDir)) {

Callers 8

shouldAutoStartServerFunction · 0.90
handleAuthCommandFunction · 0.90
runDoctorCommandFunction · 0.90
initializeTokenFunction · 0.90
initializeApiUrlFunction · 0.90
getMachineIdOrExitFunction · 0.90
updateSettingsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected