use directories::{ProjectDirs, UserDirs};
use lazy_static::lazy_static;

pub struct Util {}

const QUALIFIER: &str = "com";
const ORGANIZATION: &str = "beargod";
const APP_NAME: &str = "homer";

lazy_static! {
    static ref APP_DIRS: ProjectDirs =
        ProjectDirs::from(QUALIFIER, ORGANIZATION, APP_NAME).expect("Can not get app directories");
    static ref USER_DIRS: UserDirs = UserDirs::new().expect("Can not get user directories");
}

impl Util {
    pub fn app_name() -> String {
        APP_NAME.to_string()
    }
    pub fn app_dirs() -> &'static ProjectDirs {
        &(APP_DIRS)
    }

    pub fn user_dirs() -> &'static UserDirs {
        &(USER_DIRS)
    }
}
