[V3 instance setup] allow removing instances without taking a backup + error handling for missing data path (#1277)

This commit is contained in:
palmtree5 2018-02-14 16:39:29 -09:00 committed by Kowlin
parent e00fa2df26
commit 01e8579215

View File

@ -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!")