From e989713ed4b2d171181dade1d6b95dcabbbb0161 Mon Sep 17 00:00:00 2001 From: plazmoid Date: Mon, 31 May 2021 21:01:08 +0500 Subject: [PATCH] fixed home detection --- src/main.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0703311..c3425b0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,7 +18,7 @@ mod ssh_config; use ssh_config::TinySSHConfig; const HOST: &str = "aws-tun"; -const BASE_CONFIG: &str = "/home/plazmoid/.ssh/config"; +const BASE_CONFIG: &str = concat!(env!("HOME"), "/.ssh/config"); static mut DAEMONIZED: bool = false; @@ -248,10 +248,12 @@ fn monitor_process() -> ! { } fn main() { - panic::set_hook(Box::new(|info| { - notify(info.to_string(), true); - exit(1); - })); + if !cfg!(debug_assertions) { + panic::set_hook(Box::new(|info| { + notify(info.to_string(), true); + exit(1); + })); + } let mut args = env::args(); if let Some(arg) = args.nth(1) { if arg == "-d" {