diff --git a/crates/pop-cli/src/commands/build/spec.rs b/crates/pop-cli/src/commands/build/spec.rs index e5741151..1c420194 100644 --- a/crates/pop-cli/src/commands/build/spec.rs +++ b/crates/pop-cli/src/commands/build/spec.rs @@ -46,20 +46,20 @@ pub(crate) enum ChainType { // A development chain that runs mainly on one node. #[default] #[strum( - serialize = "Development", + serialize = "development", message = "Development", detailed_message = "Meant for a development chain that runs mainly on one node." )] Development, // A local chain that runs locally on multiple nodes for testing purposes. #[strum( - serialize = "Local", + serialize = "local", message = "Local", detailed_message = "Meant for a local chain that runs locally on multiple nodes for testing purposes." )] Local, // A live chain. - #[strum(serialize = "Live", message = "Live", detailed_message = "Meant for a live chain.")] + #[strum(serialize = "live", message = "Live", detailed_message = "Meant for a live chain.")] Live, } @@ -137,7 +137,7 @@ pub struct BuildSpecCommand { #[arg(short = 'o', long = "output")] pub(crate) output_file: Option, /// Build profile for the binary to generate the chain specification. - #[arg(short = 'r', long, value_enum)] + #[arg(long, value_enum)] pub(crate) profile: Option, /// Parachain ID to be used when generating the chain spec files. #[arg(short = 'i', long)] @@ -346,9 +346,7 @@ impl BuildSpecCommand { .placeholder(&default) .default_input(&default) .interact()? - } else { - default - } + } else { default } }, }; @@ -442,16 +440,15 @@ impl BuildSpec { // it triggers a build process. fn build(self, cli: &mut impl cli::traits::Cli) -> anyhow::Result<&'static str> { cli.intro("Building your chain spec")?; - let mut generated_files = vec![]; - let BuildSpec { ref output_file, ref profile, id, default_bootnode, ref chain, genesis_state, genesis_code, .. } = self; - // Ensure binary is built. let binary_path = ensure_binary_exists(cli, &profile)?; + let spinner = spinner(); spinner.start("Generating chain specification..."); + let mut generated_files = vec![]; // Generate chain spec. generate_plain_chain_spec( diff --git a/crates/pop-common/src/build.rs b/crates/pop-common/src/build.rs index 1169d247..3e5a4b56 100644 --- a/crates/pop-common/src/build.rs +++ b/crates/pop-common/src/build.rs @@ -16,7 +16,7 @@ use strum_macros::{VariantArray, AsRefStr, EnumMessage, EnumString}; pub enum Profile { /// Debug profile, optimized for debugging. #[strum( - serialize = "Debug", + serialize = "debug", message = "Debug", detailed_message = "Optimized for debugging." )] @@ -24,14 +24,14 @@ pub enum Profile { /// Release profile, optimized without any debugging functionality. #[default] #[strum( - serialize = "Release", + serialize = "release", message = "Release", detailed_message = "Optimized without any debugging functionality." )] Release, /// Production profile, optimized for ultimate performance. #[strum( - serialize = "Production", + serialize = "production", message = "Production", detailed_message = "Optimized for ultimate performance." )] @@ -52,9 +52,9 @@ impl Profile { impl fmt::Display for Profile { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::Debug => write!(f, "DEBUG"), - Self::Release => write!(f, "RELEASE"), - Self::Production => write!(f, "PRODUCTION"), + Self::Debug => write!(f, "debug"), + Self::Release => write!(f, "release"), + Self::Production => write!(f, "production"), } } }