1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
pub fn current_dir() -> std::path::PathBuf {
    std::env::current_dir().unwrap_or_else(|_| std::path::PathBuf::from("."))
}

pub fn current_dir_string() -> String {
    current_dir().to_string_lossy().to_string()
}

pub fn home_dir() -> std::path::PathBuf {
    dirs::home_dir().unwrap_or_else(|| std::path::PathBuf::from("/tmp"))
}