From ecd17ce9e924af1d37b439c22a2fd6562737d5b8 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Thu, 26 Sep 2024 23:28:42 -0700 Subject: [PATCH] reorder output msg --- llama_stack/cli/stack/build.py | 22 +++++++++------------- llama_stack/cli/stack/configure.py | 9 +++++---- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/llama_stack/cli/stack/build.py b/llama_stack/cli/stack/build.py index 132aef7e5..1cc0e4dc5 100644 --- a/llama_stack/cli/stack/build.py +++ b/llama_stack/cli/stack/build.py @@ -112,24 +112,20 @@ class StackBuild(Subcommand): to_write = json.loads(json.dumps(build_config.dict(), cls=EnumEncoder)) f.write(yaml.dump(to_write, sort_keys=False)) - return_code = build_image(build_config, build_file_path) - if return_code != 0: - return - cprint( f"Build spec configuration saved at {str(build_file_path)}", color="blue", ) - configure_name = ( - build_config.name - if build_config.image_type == "conda" - else (f"llamastack-{build_config.name}") - ) - cprint( - f"You can now run `llama stack configure {configure_name}`", - color="green", - ) + return_code = build_image(build_config, build_file_path) + if return_code != 0: + return + + if build_config.image_type == "conda": + cprint( + f"You can now run `llama stack configure {build_config.name}`", + color="green", + ) def _run_template_list_cmd(self, args: argparse.Namespace) -> None: import json diff --git a/llama_stack/cli/stack/configure.py b/llama_stack/cli/stack/configure.py index 76e2c5ca0..7e2dc5994 100644 --- a/llama_stack/cli/stack/configure.py +++ b/llama_stack/cli/stack/configure.py @@ -142,7 +142,8 @@ class StackConfigure(Subcommand): color="blue", ) - cprint( - f"You can now run `llama stack run {image_name} --port PORT`", - color="green", - ) + if build_config.image_type == "conda": + cprint( + f"You can now run `llama stack run {image_name} --port PORT`", + color="green", + )