Skip to content

Commit

Permalink
Trim messages so they're more consistent with feats
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Feb 7, 2025
1 parent dc24d67 commit 8fbf5ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ use self::subcommand::NixInstallerSubcommand;
const FAIL_PKG_SUGGEST: &str = "\
The Determinate Nix Installer failed.
Try our macOS-native package instead, which can handle almost anything:
https://dtr.mn/determinate-nix\
Try our macOS-native package instead, which can handle almost anything: https://dtr.mn/determinate-nix\
";

#[async_trait::async_trait]
Expand Down Expand Up @@ -109,7 +107,7 @@ impl CommandExecute for NixInstallerCli {
.get_feature_ptr_payload::<String>("dni-det-msg-fail-pkg-ptr")
.await
.unwrap_or(FAIL_PKG_SUGGEST.into());
tracing::warn!("{}", msg);
tracing::warn!("{}\n", msg.trim());

return Ok(ExitCode::FAILURE);
}
Expand Down
12 changes: 8 additions & 4 deletions src/cli/subcommand/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl CommandExecute for Install {
.get_feature_ptr_payload::<String>("dni-det-msg-start-pkg-ptr")
.await
.unwrap_or(PRE_PKG_SUGGEST.into());
tracing::info!("{}", msg);
tracing::info!("{}", msg.trim());
}

let mut post_install_message = None;
Expand Down Expand Up @@ -208,9 +208,13 @@ impl CommandExecute for Install {

loop {
let prompt = if currently_explaining {
&format!("\n{}\n{explanation}\n", base_prompt.green())
&format!(
"\n{}\n{}\n",
base_prompt.trim().green(),
explanation.trim()
)
} else {
&format!("\n{}", base_prompt.green())
&format!("\n{}", base_prompt.trim().green())
};

let response = interaction::prompt(
Expand Down Expand Up @@ -404,7 +408,7 @@ impl CommandExecute for Install {
);

if let Some(post_message) = post_install_message {
println!("{post_message}");
println!("{}", post_message.trim());
}
},
}
Expand Down

0 comments on commit 8fbf5ad

Please sign in to comment.