mirror of
https://github.com/Kruhlmann/punlock.git
synced 2025-10-28 06:33:34 +00:00
22 lines
844 B
Rust
22 lines
844 B
Rust
use std::path::PathBuf;
|
|
|
|
use directories::ProjectDirs;
|
|
use lazy_static::lazy_static;
|
|
use regex::Regex;
|
|
|
|
lazy_static! {
|
|
pub static ref LATEST_CONFIGURATION_VERSION: &'static str = "1.0.0";
|
|
pub static ref CONFIG_FILE_NAME: &'static str = "config.toml";
|
|
pub static ref PROJECT_DIRS: ProjectDirs =
|
|
ProjectDirs::from("dev", "kruhlmann", "punlock").unwrap();
|
|
pub static ref USER_CONFIG_FILE_PATH: PathBuf =
|
|
PROJECT_DIRS.config_dir().join(CONFIG_FILE_NAME.to_string());
|
|
pub static ref SYSTEM_CONFIG_PATH_CANDIDATES: Vec<PathBuf> = vec![
|
|
PathBuf::from(CONFIG_FILE_NAME.to_string()),
|
|
USER_CONFIG_FILE_PATH.to_path_buf(),
|
|
PathBuf::from("/etc/punlock/").join("CONFIG_FILE_NAME"),
|
|
]
|
|
.to_vec();
|
|
pub static ref EMAIL_REGEX: Regex = Regex::new(r"^[^\s@]+@[^\s@]+\.[^\s@]+$").unwrap();
|
|
}
|