From eb1cfb6ead099479d56283d055c22d9c60d0ec15 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sat, 15 Mar 2025 17:43:22 -0600 Subject: [PATCH] use different default config for bsds --- src/main.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index d908081..70f27ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,11 +32,12 @@ struct Args { } fn get_config_default() -> &'static str { - if cfg!(windows) { - "C:\\ProgramData\\refractr\\config.toml" - } else { - "/etc/refractr/config.toml" - } + #[cfg(target_os = "windows")] + return "C:\\ProgramData\\refractr\\config.toml"; + #[cfg(target_os = "linux")] + return "/etc/refractr/config.toml"; + #[cfg(any(target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))] + return "/usr/local/etc/refractr/config.toml"; } fn main() -> Result<(), String> {