Skip to content

Commit

Permalink
chore: adapt client name for safe cli cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
grumbach committed Mar 26, 2024
1 parent 40e64de commit 9b9db26
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sn_logging/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,18 @@ fn curent_exe_name() -> String {
.and_then(|arg| {
std::path::Path::new(&arg).file_name().map(|s| {
let mut name = s.to_string_lossy().into_owned();
// remove sn_ prefix if present
name = name.strip_prefix("sn_").unwrap_or(&name).to_owned();

// remove .exe prefix on windows
if cfg!(windows) && name.to_lowercase().ends_with(".exe") {
name = name.strip_suffix(".exe").unwrap_or(&name).to_owned();
}

// if the name is safe, identify it is the client
if name == "safe" {
name = "client".to_string();
}
name
})
})
Expand Down

0 comments on commit 9b9db26

Please sign in to comment.