mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
[V3 instance setup] allow removing instances without taking a backup + error handling for missing data path (#1277)
This commit is contained in:
parent
e00fa2df26
commit
01e8579215
@ -190,12 +190,22 @@ def remove_instance():
|
||||
)
|
||||
)
|
||||
print("Removing the instance...")
|
||||
shutil.rmtree(str(pth))
|
||||
try:
|
||||
shutil.rmtree(str(pth))
|
||||
except FileNotFoundError:
|
||||
pass # data dir was removed manually
|
||||
save_config(selected, {}, remove=True)
|
||||
print("The instance has been removed")
|
||||
return
|
||||
elif yesno.lower() == "n":
|
||||
print("Ok then")
|
||||
pth = Path(instance_data["DATA_PATH"])
|
||||
print("Removing the instance...")
|
||||
try:
|
||||
shutil.rmtree(str(pth))
|
||||
except FileNotFoundError:
|
||||
pass # data dir was removed manually
|
||||
save_config(selected, {}, remove=True)
|
||||
print("The instance has been removed")
|
||||
return
|
||||
else:
|
||||
print("That's not a valid option!")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user