| 3 | import { t } from "i18next"; |
| 4 | |
| 5 | function readCategoryConfig(configCategory: string, callback: (config: any) => boolean) { |
| 6 | const configPaths = StorageSubsystem.readDir(configCategory); |
| 7 | for (const configPath of configPaths) { |
| 8 | try { |
| 9 | const config = JSON.parse(StorageSubsystem.readFile(configPath)); |
| 10 | if (callback(config)) { |
| 11 | logger.info(t("TXT_CODE_6b2a9cab"), configPath); |
| 12 | StorageSubsystem.writeFile(configPath, JSON.stringify(config, null, 4)); |
| 13 | } |
| 14 | } catch (error: any) { |
| 15 | logger.error(t("TXT_CODE_fb75aba9"), error); |
| 16 | } |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | function refactorInstanceConfig(config: any) { |
| 21 | if (isNaN(config.passWordType)) config.passWordType = 0; |