diff --git a/src/gui.rs b/src/gui.rs index f3d8cf1..85b5a07 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -61,10 +61,16 @@ fn build_ui(app: &Application) { container.append(&image); let dest_path = - Path::new("/home/user.cache/LinuxWEGUI/").join(path.file_name().unwrap()); + Path::new("/home/user/.cache/LinuxWEGUI/").join(path.file_name().unwrap()); + + if let Some(parent_dir) = dest_path.parent() { + fs::create_dir_all(parent_dir).expect("Failed to create parent directory"); + } fs::copy(path, dest_path).expect("yeet"); + // fs::copy(path, dest_path).expect("yeet"); + // fs::copy(path, "/home/user.cache/LinuxWEGUI/").expect("yeet"); } }