Skip to content

Commit

Permalink
Merge pull request #677 from Financial-Times/split-config-loading
Browse files Browse the repository at this point in the history
refactor: split out task running and config loading
  • Loading branch information
apaleslimghost authored Oct 1, 2024
2 parents 53a4604 + 5355541 commit c46f3a3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/cli/src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ const loadTasks = async (
return reduceValidated(taskResults)
}

export async function runTasks(logger: Logger, commands: string[], files?: string[]): Promise<void> {
const config = await loadConfig(logger)

export async function runTasksFromConfig(logger: Logger, config: ValidConfig, commands: string[], files?: string[]): Promise<void> {
for (const pluginOptions of Object.values(config.pluginOptions)) {
if (pluginOptions.forPlugin) {
setOptions(pluginOptions.forPlugin.id as OptionKey, pluginOptions.options)
Expand Down Expand Up @@ -131,3 +129,9 @@ ${error.details}`
}
}
}

export async function runTasks(logger: Logger, commands: string[], files?: string[]): Promise<void> {
const config = await loadConfig(logger)

return runTasksFromConfig(logger, config, commands, files)
}

0 comments on commit c46f3a3

Please sign in to comment.