set log path for unix to /var/log

fixes #149
This commit is contained in:
2024-09-24 17:31:47 +02:00
parent db15f29e40
commit 15ee7d570b

View File

@@ -554,9 +554,13 @@ fn arg_remove_value(args: &mut Vec<String>, arg: &str) {
#[tokio::main] #[tokio::main]
async fn main() { async fn main() {
#[cfg(windows)]
let log_file = env::current_exe() let log_file = env::current_exe()
.unwrap_or(PathBuf::from("alterware-launcher")) .unwrap_or(PathBuf::from("alterware-launcher"))
.with_extension("log"); .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() { if log_file.exists() && fs::remove_file(&log_file).is_err() {
println!("Couldn't clear log file, make sure target directory is writable."); println!("Couldn't clear log file, make sure target directory is writable.");
} }