Skip to content

Commit

Permalink
fix: rename delete command on undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
imLymei committed Sep 16, 2024
1 parent 5cb8b26 commit 84b8cf4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/commands/renameCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit 84b8cf4

Please sign in to comment.