Skip to content

Commit 5355541

Browse files
refactor: split out task running and config loading
1 parent 53a4604 commit 5355541

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

core/cli/src/tasks.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ const loadTasks = async (
5656
return reduceValidated(taskResults)
5757
}
5858

59-
export async function runTasks(logger: Logger, commands: string[], files?: string[]): Promise<void> {
60-
const config = await loadConfig(logger)
61-
59+
export async function runTasksFromConfig(logger: Logger, config: ValidConfig, commands: string[], files?: string[]): Promise<void> {
6260
for (const pluginOptions of Object.values(config.pluginOptions)) {
6361
if (pluginOptions.forPlugin) {
6462
setOptions(pluginOptions.forPlugin.id as OptionKey, pluginOptions.options)
@@ -131,3 +129,9 @@ ${error.details}`
131129
}
132130
}
133131
}
132+
133+
export async function runTasks(logger: Logger, commands: string[], files?: string[]): Promise<void> {
134+
const config = await loadConfig(logger)
135+
136+
return runTasksFromConfig(logger, config, commands, files)
137+
}

0 commit comments

Comments
 (0)