From 48c4e7b4a73783fe2e9e26520a3bead7398a3cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Thu, 23 Mar 2023 21:39:44 +0100 Subject: [PATCH] Fetch avatar and logs from current_dir instead of static path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1ef1df8..dba1a20 100644 --- a/src/main.rs +++ b/src/main.rs @@ -191,9 +191,10 @@ async fn do_main() -> io::Result<()> { .queue(terminal::DisableLineWrap)? .queue(crossterm::event::EnableBracketedPaste)? .queue(terminal::Clear(terminal::ClearType::All))?; - let image = image::open("/home/linkmauve/avatar.png").unwrap(); + let current_dir = std::env::current_dir()?; + let image = image::open(current_dir.join("avatar.png")).unwrap(); render_image(image, 16, 16)?; - let mut file = std::fs::File::open("/home/linkmauve/logs.log")?; + let mut file = std::fs::File::open(current_dir.join("logs.log"))?; let mut data = String::new(); file.read_to_string(&mut data)?; let logs = logger::parse_logs(&data).unwrap().1;