From dc4f32a006f5135dfb43e7eabd0124301c8e9b9e Mon Sep 17 00:00:00 2001 From: Greaka Date: Thu, 4 Jul 2019 12:13:17 +0200 Subject: [PATCH] create log folder if not existent --- src/worker/log.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/worker/log.rs b/src/worker/log.rs index a6140dd..b81ede9 100644 --- a/src/worker/log.rs +++ b/src/worker/log.rs @@ -4,10 +4,12 @@ use std::io::Write; use std::sync::mpsc::Receiver; static NAME: &'static str = "log"; +static FILE_PATH: &'static str = "addons/bhud"; static FILE_NAME: &'static str = "addons/bhud/errors.log"; pub fn new() { let action = |rx: Receiver| { + std::fs::create_dir_all(FILE_PATH); let mut file_res = OpenOptions::new().append(true).create(true).open(FILE_NAME); loop { let content = rx.recv().unwrap();