()
| 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 | } |
no test coverage detected