From ae093bd065d32e5870c14803431546243a1b71e5 Mon Sep 17 00:00:00 2001 From: Kara Brightwell Date: Wed, 24 Apr 2024 17:38:24 +0100 Subject: [PATCH] fix: allow tasks with schemas not to have options provided in the config --- core/cli/src/tasks.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/cli/src/tasks.ts b/core/cli/src/tasks.ts index 92b3eab51..c564776fe 100644 --- a/core/cli/src/tasks.ts +++ b/core/cli/src/tasks.ts @@ -30,9 +30,8 @@ const loadTasks = async ( return taskResult.map((Task) => { const taskSchema = TaskSchemas[taskId as keyof TaskOptions] - const parsedOptions = taskSchema - ? taskSchema.parse({ ...config.taskOptions[taskId].options, ...options }) - : {} + const configOptions = config.taskOptions[taskId]?.options ?? {} + const parsedOptions = taskSchema ? taskSchema.parse({ ...configOptions, ...options }) : {} const task = new (Task as unknown as TaskConstructor)( logger,