diff --git a/compat/getConfig.ts b/compat/getConfig.ts index 06d6878..8fea5f6 100644 --- a/compat/getConfig.ts +++ b/compat/getConfig.ts @@ -11,7 +11,7 @@ const matchConfig = dictionary([string, any]); * Call with the configuration to get a standard getConfig for the expected exports * Assumption: start9/config.yaml is where the config will be stored * Throws: Error if there is no file - * Throws: Error if the config.yaml isn't yaml nor config shape + * Throws: Error if the config.yaml isn't yaml nor config shape * @param spec * @returns */ @@ -28,6 +28,7 @@ export const getConfig = (spec: ConfigSpec): ExpectedExports.getConfig => effects.info(`Got error ${e} while trying to read the config`); return undefined; }); + return { result: { config, diff --git a/compat/migrations.ts b/compat/migrations.ts index 156a263..303cc1c 100644 --- a/compat/migrations.ts +++ b/compat/migrations.ts @@ -20,7 +20,7 @@ export function updateConfig< version extends string, type extends "up" | "down", >( - fn: (config: T.Config) => T.Config, + fn: (config: T.Config, effects: T.Effects) => T.Config, configured: boolean, noRepeat?: NoRepeat, noFail = false, @@ -30,7 +30,7 @@ export function updateConfig< let config = util.unwrapResultType(await getConfig({})(effects)).config; if (config) { try { - config = fn(config); + config = fn(config, effects); } catch (e) { if (!noFail) { throw e;