Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: split out task running and config loading #677

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}