MCPcopy Create free account
hub / github.com/cameri/nostream / ensureSettingsExists

Function ensureSettingsExists

src/cli/utils/config.ts:242–254  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

240}
241
242export const ensureSettingsExists = (): void => {
243 const configDir = getConfigBaseDir()
244 const settingsPath = getSettingsFilePath()
245 const defaultsPath = getDefaultSettingsFilePath()
246
247 if (!fs.existsSync(configDir)) {
248 fs.mkdirSync(configDir, { recursive: true })
249 }
250
251 if (!fs.existsSync(settingsPath)) {
252 fs.copyFileSync(defaultsPath, settingsPath)
253 }
254}
255
256export const loadDefaults = (): Settings => {
257 const defaultsRaw = fs.readFileSync(getDefaultSettingsFilePath(), 'utf-8')

Callers 2

loadUserSettingsFunction · 0.85
saveSettingsFunction · 0.85

Calls 3

getConfigBaseDirFunction · 0.90
getSettingsFilePathFunction · 0.90

Tested by

no test coverage detected