From 06f1dc6ade14303ee0a5687a49d75114f17fef43 Mon Sep 17 00:00:00 2001 From: Grashalmbeisser <57599830+Grashalmbeisser@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:16:48 +0100 Subject: [PATCH] added support for overriding default ports (#178) * added support for overriding default ports * Update src/viur_cli/local.py Co-authored-by: Sven Eberth * Apply suggestions from code review Co-authored-by: Sven Eberth * Update src/viur_cli/local.py Co-authored-by: Sven Eberth --------- Co-authored-by: Sven Eberth --- src/viur_cli/local.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/viur_cli/local.py b/src/viur_cli/local.py index 1fd74c8..aad774b 100644 --- a/src/viur_cli/local.py +++ b/src/viur_cli/local.py @@ -46,10 +46,13 @@ def run(profile, additional_args): f"Please install the 'gcloud' tool or Log in with an appropriate account.") conf = config.get_profile(profile) + additional_args = list(additional_args) - if appyaml := conf.get("appyaml"): - additional_args = [f"--appyaml={appyaml}", *additional_args] - + if conf.get("port"): + additional_args.append(f"--port={conf['port']}") + if conf.get("gunicorn_port"): + additional_args.append(f"--gunicorn_port={conf['gunicorn_port']}") + utils.system( f'app_server -A={conf["application_name"]} {conf["distribution_folder"]} {" ".join(additional_args)}')