From 50bd42b1abaecb7da2836f6d1119aefa39cba2ed Mon Sep 17 00:00:00 2001 From: Jens Kreutschmann Date: Sat, 23 Feb 2019 01:16:05 +0100 Subject: [PATCH] Added warning when a command with the same name is loaded twice --- src/BundleManager.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/BundleManager.js b/src/BundleManager.js index ca6f354d..50bbc3a6 100644 --- a/src/BundleManager.js +++ b/src/BundleManager.js @@ -404,6 +404,11 @@ class BundleManager { } const commandName = path.basename(commandFile, path.extname(commandFile)); + + if (this.state.CommandManager.get(commandName)) { + Logger.warn(`Command '${commandName}' already exists and will be discarded`); + } + const command = this.createCommand(commandPath, commandName, bundle); this.state.CommandManager.add(command); }