(path: string, fileType: SettingsFileTypes)
| 49 | } |
| 50 | |
| 51 | public static loadSettings(path: string, fileType: SettingsFileTypes) { |
| 52 | logger('loading settings from %s', path) |
| 53 | |
| 54 | switch (fileType) { |
| 55 | case SettingsFileTypes.json: { |
| 56 | logger.warn('settings.json is deprecated, please use a yaml file based on resources/default-settings.yaml') |
| 57 | return SettingsStatic.loadAndParseJsonFile(path) |
| 58 | } |
| 59 | case SettingsFileTypes.yaml: { |
| 60 | return SettingsStatic.loadAndParseYamlFile(path) |
| 61 | } |
| 62 | default: { |
| 63 | throw new Error('settings file was missing or did not contain .yaml or .json extensions.') |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | public static createSettings(): Settings { |
| 69 | if (SettingsStatic._settings) { |
no test coverage detected