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