From c1d5b9fed6d2388f6cf30668ba5329da169637c4 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sat, 15 Mar 2025 17:20:33 -0600 Subject: [PATCH] taking into account bsd as well --- Cargo.toml | 5 +++-- src/main.rs | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 30efec1..cc4c00a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,8 @@ serde = "1.0.217" serde_derive = "1.0.217" sha2 = "0.10.8" toml = "0.8.20" +[target.'cfg(not(target_family = "unix"))'.dependencies] username = "0.2.0" -[target.'cfg(target_os = "linux")'.dependencies] -users = "0.11.0" +[target.'cfg(target_family = "unix")'.dependencies] +users = "0.11.0" \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index e59f131..990eea4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,10 +7,10 @@ use crate::refractr::Refractr; use clap::Parser; use std::path::PathBuf; use std::process; -use username; - -#[cfg(target_os = "linux")] +#[cfg(target_family = "unix")] use users; +#[cfg(not(target_family = "unix"))] +use username; #[derive(Parser)] #[command(name = "refractr")] @@ -41,7 +41,6 @@ fn get_config_default() -> &'static str { fn main() -> Result<(), String> { let args = Args::parse(); - println!("{}", username::get_user_name().unwrap()); let refractr = Refractr { docker: match option_env!("REFRACTR_DOCKER") { Some(v) => match v {