Skip to content

Commit

Permalink
chore: disable env section of color_eyre report (#196)
Browse files Browse the repository at this point in the history
alternative to #195 

this pr removes this section for non-debug (dev profile) builds:

![env_section_suggestion](https://github.com/user-attachments/assets/5851a347-ba20-4b6d-a9b7-6fa453853bfc)

it's enabled when binary is installed with `cargo install --locked
--profile dev cargo-near`,
when backtraces have source code info

Co-authored-by: dj8yf0μl <[email protected]>
  • Loading branch information
dj8yfo and dj8yf0μl authored Aug 6, 2024
1 parent f1afe7b commit 1f59dd4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cargo-near/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ fn main() -> CliResult {

let config = near_cli_rs::config::Config::get_config_toml()?;

color_eyre::install()?;

#[cfg(not(debug_assertions))]
let display_env_section = false;
#[cfg(debug_assertions)]
let display_env_section = true;
color_eyre::config::HookBuilder::default()
.display_env_section(display_env_section)
.install()?;
let cli = match Cmd::try_parse() {
Ok(cli) => cli,
Err(error) => error.exit(),
Expand Down

0 comments on commit 1f59dd4

Please sign in to comment.