From 5794e5223754270441ba3374086871f10e04a977 Mon Sep 17 00:00:00 2001 From: Danil Date: Thu, 11 Jul 2024 14:20:06 +0200 Subject: [PATCH] Add ecosystem name Signed-off-by: Danil --- zk_toolbox/crates/config/src/ecosystem.rs | 2 +- .../crates/zk_inception/src/commands/ecosystem/create.rs | 4 ++-- zk_toolbox/crates/zk_inception/src/messages.rs | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/zk_toolbox/crates/config/src/ecosystem.rs b/zk_toolbox/crates/config/src/ecosystem.rs index 7a7456ded1cb..60ca22e9a9b0 100644 --- a/zk_toolbox/crates/config/src/ecosystem.rs +++ b/zk_toolbox/crates/config/src/ecosystem.rs @@ -102,7 +102,7 @@ impl EcosystemConfig { pub fn from_file(shell: &Shell) -> Result { let path = PathBuf::from(CONFIG_NAME); - if !shell.path_exists(&path) { + if !shell.path_exists(path) { return Err(EcosystemConfigFromFileError::NotExists { path: shell.current_dir(), }); diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs index e4b06154e37e..52d116038f69 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/create.rs @@ -19,7 +19,7 @@ use crate::{ }, }, messages::{ - MSG_CLONING_ERA_REPO_SPINNER, MSG_CREATED_ECOSYSTEM, MSG_CREATING_DEFAULT_CHAIN_SPINNER, + msg_created_ecosystem, MSG_CLONING_ERA_REPO_SPINNER, MSG_CREATING_DEFAULT_CHAIN_SPINNER, MSG_CREATING_ECOSYSTEM, MSG_CREATING_INITIAL_CONFIGURATIONS_SPINNER, MSG_ECOSYSTEM_ALREADY_EXISTS_ERR, MSG_ECOSYSTEM_CONFIG_INVALID_ERR, MSG_SELECTED_CONFIG, MSG_STARTING_CONTAINERS_SPINNER, @@ -111,6 +111,6 @@ fn create(args: EcosystemCreateArgs, shell: &Shell) -> anyhow::Result<()> { spinner.finish(); } - logger::outro(MSG_CREATED_ECOSYSTEM); + logger::outro(msg_created_ecosystem(&ecosystem_name)); Ok(()) } diff --git a/zk_toolbox/crates/zk_inception/src/messages.rs b/zk_toolbox/crates/zk_inception/src/messages.rs index c98f76b751c8..94614ee86e6f 100644 --- a/zk_toolbox/crates/zk_inception/src/messages.rs +++ b/zk_toolbox/crates/zk_inception/src/messages.rs @@ -22,7 +22,11 @@ pub(super) const MSG_L1_NETWORK_PROMPT: &str = "Select the L1 network"; pub(super) const MSG_START_CONTAINERS_PROMPT: &str = "Do you want to start containers after creating the ecosystem?"; pub(super) const MSG_CREATING_ECOSYSTEM: &str = "Creating ecosystem"; -pub(super) const MSG_CREATED_ECOSYSTEM: &str = "Ecosystem created successfully (All subsequent commands should be executed from ecosystem folder `cd path/to/ecosystem/name`)"; + +pub fn msg_created_ecosystem(name: &str) -> String { + format!("Ecosystem {name} created successfully (All subsequent commands should be executed from ecosystem folder `cd path/to/ecosystem/name`)") +} + pub(super) const MSG_CLONING_ERA_REPO_SPINNER: &str = "Cloning zksync-era repository..."; pub(super) const MSG_CREATING_INITIAL_CONFIGURATIONS_SPINNER: &str = "Creating initial configurations...";