From 63c45f732714a360a783c28c88dd952aa64397ad Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 4 Dec 2025 15:10:25 +0800 Subject: [PATCH] fix: failed to create with builtin tools --- src/index.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index 99a4662..211ac0a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -347,13 +347,15 @@ export async function create({ const matchedTool = extraTools.find( (extraTool) => extraTool.value === tool, ); - if (matchedTool?.action) { - await matchedTool.action(); - } - if (matchedTool?.command) { - runCommand(matchedTool.command, distFolder); + if (matchedTool) { + if (matchedTool.action) { + await matchedTool.action(); + } + if (matchedTool.command) { + runCommand(matchedTool.command, distFolder); + } + continue; } - continue; } // Handle built-in tools