mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-17 18:51:14 +01:00
15 lines
488 B
TypeScript
15 lines
488 B
TypeScript
|
|
import fs from 'fs';
|
||
|
|
import { ConfigType } from '../../types/config';
|
||
|
|
import { Config } from '../types';
|
||
|
|
import { migrateConfig } from './migrateConfig';
|
||
|
|
|
||
|
|
export function backendMigrateConfig(config: Config, name: string): ConfigType {
|
||
|
|
const migratedConfig = migrateConfig(config);
|
||
|
|
|
||
|
|
// Overrite the file ./data/configs/${name}.json
|
||
|
|
// with the new config format
|
||
|
|
fs.writeFileSync(`./data/configs/${name}.json`, JSON.stringify(migratedConfig, null, 2));
|
||
|
|
|
||
|
|
return migratedConfig;
|
||
|
|
}
|