file-organizer 0.4.0

A powerful, cross-platform file organization tool
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::error::OrganizeError;
use crate::models::Paths;
use rfd::FileDialog;

pub fn get_output_location() -> Result<Paths, OrganizeError> {
    let input_path = FileDialog::new()
        .set_title("Select folder to organize")
        .set_directory(dirs::home_dir().unwrap_or_default()) // Start from home directory
        .pick_folder()
        .ok_or(OrganizeError::NoPathSelected)?;

    Ok(Paths {
        output_path: input_path.clone(), // This will be replaced by main.rs logic
        input_path,
    })
}