Skip to content

Commit

Permalink
refactor: split out task running and config loading
Browse files Browse the repository at this point in the history
  • Loading branch information
apaleslimghost committed Oct 1, 2024
1 parent 53a4604 commit 5355541
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 5355541

Please sign in to comment.