use clap::crate_name;
use directories::ProjectDirs;
use lazy_static::lazy_static;
use std::path::PathBuf;
lazy_static! {
pub static ref EXCLUDE_FILE_PATH: PathBuf = {
let mut exclude_file_path = ProjectDirs::from("", crate_name!(), crate_name!())
.unwrap()
.config_local_dir()
.to_path_buf();
exclude_file_path.push("exclude.txt");
exclude_file_path
};
pub static ref HISTORY_DIR_PATH: PathBuf = {
let mut history_dir_path = ProjectDirs::from("", crate_name!(), crate_name!())
.unwrap()
.config_local_dir()
.to_path_buf();
history_dir_path.push("history");
history_dir_path
};
pub static ref BACKUP_DIR_PATH: PathBuf = {
let mut backup_dir_path = ProjectDirs::from("", crate_name!(), crate_name!())
.unwrap()
.config_local_dir()
.to_path_buf();
backup_dir_path.push("backups");
backup_dir_path
};
}
#[cfg(test)]
pub mod tests {
use lazy_static::lazy_static;
use std::path::PathBuf;
lazy_static! {
pub static ref TMP_DIR_PATH: PathBuf = {
let mut tmp_dir = std::env::current_dir().unwrap();
tmp_dir.push(".tmp");
tmp_dir
};
}
}