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 62f879c
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
use crate::{
config::{user_cache_directory, user_configuration_directory},
utils::user_runtime_directory,
};
use crate::config::{user_cache_directory, user_configuration_directory};

/// Print platform info like which platform directories will be used.
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 +17,19 @@ 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)]
{
use crate::utils::user_runtime_directory;

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 62f879c

Please sign in to comment.