From 15ee7d570b9aa705a9281fec654c7ab9571afb30 Mon Sep 17 00:00:00 2001 From: mxve <68632137+mxve@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:31:47 +0200 Subject: [PATCH] set log path for unix to /var/log fixes #149 --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index bc2dc23..a6d4c22 100644 --- a/src/main.rs +++ b/src/main.rs @@ -554,9 +554,13 @@ fn arg_remove_value(args: &mut Vec, arg: &str) { #[tokio::main] async fn main() { + #[cfg(windows)] let log_file = env::current_exe() .unwrap_or(PathBuf::from("alterware-launcher")) .with_extension("log"); + #[cfg(unix)] + let log_file = PathBuf::from("/var/log/alterware-launcher.log"); + if log_file.exists() && fs::remove_file(&log_file).is_err() { println!("Couldn't clear log file, make sure target directory is writable."); }