mirror of
https://github.com/Kruhlmann/punlock.git
synced 2025-10-28 14:43:35 +00:00
Initial commit
This commit is contained in:
21
src/statics.rs
Normal file
21
src/statics.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
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();
|
||||
}
|
||||
Reference in New Issue
Block a user