mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -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...")
|
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)
|
save_config(selected, {}, remove=True)
|
||||||
print("The instance has been removed")
|
print("The instance has been removed")
|
||||||
return
|
return
|
||||||
elif yesno.lower() == "n":
|
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
|
return
|
||||||
else:
|
else:
|
||||||
print("That's not a valid option!")
|
print("That's not a valid option!")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user