From 9ecea9e1d5224fc4a7c385ee08a0307ed396c221 Mon Sep 17 00:00:00 2001 From: palmtree5 <3577255+palmtree5@users.noreply.github.com> Date: Wed, 28 Mar 2018 15:13:34 -0800 Subject: [PATCH] [V3 instance setup] Warn and request confirmation if instance name already in use (#1469) --- redbot/setup.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/redbot/setup.py b/redbot/setup.py index 0de3ab768..1c2de49e8 100644 --- a/redbot/setup.py +++ b/redbot/setup.py @@ -63,6 +63,14 @@ def save_config(name, data, remove=False): if remove and name in config: config.pop(name) else: + if name in config: + print( + "WARNING: An instance already exists with this name. " + "Continuing will overwrite the existing instance config." + ) + if not confirm("Are you absolutely certain you want to continue (y/n)? "): + print("Not continuing") + sys.exit(0) config[name] = data JsonIO(config_file)._save_json(config)