diff --git a/lib/config/setupConfig.ts b/lib/config/setupConfig.ts index 05263e7..bc6c00a 100644 --- a/lib/config/setupConfig.ts +++ b/lib/config/setupConfig.ts @@ -20,7 +20,10 @@ export type Save< input: ExtractConfigType & Record utils: Utils dependencies: D.Dependencies -}) => Promise +}) => Promise<{ + dependenciesReceipt: DependenciesReceipt + restart: boolean +}> export type Read< WD, A extends Record | Config, any>, @@ -52,12 +55,15 @@ export function setupConfig< await effects.console.error(String(validator.errorMessage(input))) return { error: "Set config type error for config" } } - await write({ + const { restart } = await write({ input: JSON.parse(JSON.stringify(input)), effects, utils: utils(effects), dependencies: D.dependenciesSet(), }) + if (restart) { + await effects.restart() + } }) as ExpectedExports.setConfig, getConfig: (async ({ effects }) => { const myUtils = utils(effects)