Skip to content

Commit

Permalink
fix: don't print runtime path on Windows
Browse files Browse the repository at this point in the history
Windows doesn't use the runtime path so it shouldn't be printed there.
  • Loading branch information
ThomasFrans committed Nov 9, 2023
1 parent 2e0d08b commit c0e2d43
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::{
pub fn info() -> Result<(), String> {
let user_configuration_directory = user_configuration_directory();
let user_cache_directory = user_cache_directory();
let user_runtime_directory = user_runtime_directory();

println!(
"USER CONFIGURATION PATH: {}",
Expand All @@ -21,12 +20,17 @@ pub fn info() -> Result<(), String> {
.map(|path| path.to_string_lossy().to_string())
.unwrap_or("not found".into())
);
println!(
"USER RUNTIME PATH: {}",
user_runtime_directory
.map(|path| path.to_string_lossy().to_string())
.unwrap_or("not found".into())
);

#[cfg(unix)]
{
let user_runtime_directory = user_runtime_directory();
println!(
"USER RUNTIME PATH: {}",
user_runtime_directory
.map(|path| path.to_string_lossy().to_string())
.unwrap_or("not found".into())
);
}

Ok(())
}

0 comments on commit c0e2d43

Please sign in to comment.