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 Jul 29, 2024
1 parent 789e594 commit a9b88bd
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 @@ -126,3 +124,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 a9b88bd

Please sign in to comment.