mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -05:00
[V3 Launcher] Fixed issue with update choice (#1649)
* [V3 Launcher] Fixed issue with update choice extras_selectors() was run even if what the user did input for the development choice (stable/dev) was wrong * [V3 Launcher] Option to go back when updating * [V3 Launcher] Fixed coding style
This commit is contained in:
parent
5ec25959df
commit
f275c6e5e7
@ -310,16 +310,20 @@ def extras_selector():
|
||||
return selected
|
||||
|
||||
|
||||
def development_choice(reinstall=False):
|
||||
def development_choice(reinstall=False, can_go_back=True):
|
||||
while True:
|
||||
print("\n")
|
||||
print("Do you want to install stable or development version?")
|
||||
print("1. Stable version")
|
||||
print("2. Development version")
|
||||
if can_go_back:
|
||||
print("\n")
|
||||
print("0. Go back")
|
||||
choice = user_choice()
|
||||
print("\n")
|
||||
selected = extras_selector()
|
||||
|
||||
if choice == "1":
|
||||
selected = extras_selector()
|
||||
update_red(
|
||||
dev=False,
|
||||
reinstall=reinstall,
|
||||
@ -330,6 +334,7 @@ def development_choice(reinstall=False):
|
||||
)
|
||||
break
|
||||
elif choice == "2":
|
||||
selected = extras_selector()
|
||||
update_red(
|
||||
dev=True,
|
||||
reinstall=reinstall,
|
||||
@ -339,6 +344,10 @@ def development_choice(reinstall=False):
|
||||
mongo=True if "mongo" in selected else False,
|
||||
)
|
||||
break
|
||||
elif choice == "0" and can_go_back:
|
||||
return False
|
||||
clear_screen()
|
||||
return True
|
||||
|
||||
|
||||
def debug_info():
|
||||
@ -396,7 +405,7 @@ def main_menu():
|
||||
run_red(instance, autorestart=False, cliflags=cli_flags)
|
||||
wait()
|
||||
elif choice == "3":
|
||||
development_choice()
|
||||
if development_choice():
|
||||
wait()
|
||||
elif choice == "4":
|
||||
basic_setup()
|
||||
@ -420,14 +429,14 @@ def main_menu():
|
||||
print("0. Back")
|
||||
choice = user_choice()
|
||||
if choice == "1":
|
||||
development_choice(reinstall=True)
|
||||
if development_choice(reinstall=True):
|
||||
wait()
|
||||
elif choice == "2":
|
||||
loop.run_until_complete(reset_red())
|
||||
wait()
|
||||
elif choice == "3":
|
||||
loop.run_until_complete(reset_red())
|
||||
development_choice(reinstall=True)
|
||||
development_choice(reinstall=True, can_go_back=False)
|
||||
wait()
|
||||
elif choice == "0":
|
||||
break
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user