diff --git a/src/commands/renameCommand.ts b/src/commands/renameCommand.ts index a4fc3bf..a9de1c2 100644 --- a/src/commands/renameCommand.ts +++ b/src/commands/renameCommand.ts @@ -9,6 +9,11 @@ const renameCommand = new Command('rename') .action((oldName: string, newName: string) => { const config = getConfig(); + if (!config.commands[oldName]) { + console.error('Command not found'); + process.exit(1); + } + config.commands[newName] = config.commands[oldName]; delete config.commands[oldName];