6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-04 19:03:39 +00:00

fix: ask whether we run as prod in local launch

User was no longer asked whether they wanted to run on prod or not. In
other words, it was not convenient to run as local.overhang.io.
This commit is contained in:
Régis Behmo 2023-08-16 18:46:28 +02:00 committed by Régis Behmo
parent 67009fb857
commit b51fdb46f3
2 changed files with 6 additions and 5 deletions

View File

@ -0,0 +1 @@
- [Bugfix] Ask whether user wants to run locally during `tutor local launch`. (by @regisb)

View File

@ -90,13 +90,13 @@ def launch(
skip_build: bool,
) -> None:
context_name = context.obj.NAME
run_for_prod = context_name != "dev"
run_for_prod = False if context_name == "dev" else None
utils.warn_macos_docker_memory()
# Upgrade has to run before configuration
interactive_upgrade(context, not non_interactive, run_for_prod)
interactive_configuration(context, not non_interactive, run_for_prod)
interactive_upgrade(context, not non_interactive, run_for_prod=run_for_prod)
interactive_configuration(context, not non_interactive, run_for_prod=run_for_prod)
config = tutor_config.load(context.obj.root)
@ -136,7 +136,7 @@ def launch(
def interactive_upgrade(
context: click.Context, interactive: bool, run_for_prod: bool
context: click.Context, interactive: bool, run_for_prod: t.Optional[bool]
) -> None:
"""
Piece of code that is only used in launch.
@ -187,7 +187,7 @@ Are you sure you want to continue?"""
def interactive_configuration(
context: click.Context, interactive: bool, run_for_prod: bool
context: click.Context, interactive: bool, run_for_prod: t.Optional[bool] = None
) -> None:
click.echo(fmt.title("Interactive platform configuration"))
config = tutor_config.load_minimal(context.obj.root)