MCPcopy Index your code
hub / github.com/cameri/nostream / watchSettings

Method watchSettings

src/utils/settings.ts:109–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107 }
108
109 public static watchSettings() {
110 const basePath = SettingsStatic.getSettingsFileBasePath()
111 const defaultsFilePath = SettingsStatic.getDefaultSettingsFilePath()
112 const fileType = SettingsStatic.settingsFileType(basePath)
113 const settingsFilePath = join(basePath, `settings.${fileType}`)
114
115 const reload = () => {
116 logger('reloading settings')
117 SettingsStatic._settings = undefined
118 SettingsStatic.createSettings()
119 }
120
121 return [fs.watch(defaultsFilePath, 'utf8', reload), fs.watch(settingsFilePath, 'utf8', reload)]
122 }
123}

Callers 2

runMethod · 0.80
runMethod · 0.80

Calls 3

settingsFileTypeMethod · 0.80

Tested by

no test coverage detected