(path: string)
| 36 | } |
| 37 | |
| 38 | public static settingsFileType(path: string): SettingsFileTypes | undefined { |
| 39 | const files: string[] = fs.readdirSync(path) |
| 40 | const filteredFile = files.find((fn) => fn.startsWith('settings')) |
| 41 | if (filteredFile) { |
| 42 | const extension = extname(filteredFile).substring(1) |
| 43 | if (SettingsFileTypes[extension]) { |
| 44 | return SettingsFileTypes[extension] |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | return SettingsFileTypes.yaml |
| 49 | } |
| 50 | |
| 51 | public static loadSettings(path: string, fileType: SettingsFileTypes) { |
| 52 | logger('loading settings from %s', path) |
no outgoing calls
no test coverage detected