fix: better handle the csv data

This commit is contained in:
silver 2023-09-16 19:47:39 +01:00
parent 55c042861f
commit 3cf298f137
3 changed files with 132 additions and 6 deletions

View file

@ -25,6 +25,7 @@ pub struct Config {
pub home: String,
pub database: String,
pub csv: String,
pub mail_smtp: String,
pub mail_user: String,
@ -53,6 +54,7 @@ pub fn get_config() -> Config {
home: ".".to_string(),
database: "database.db".to_string(),
csv: "wolves.csv".to_string(),
mail_smtp: "".to_string(),
mail_user: "".to_string(),
@ -84,6 +86,9 @@ pub fn get_config() -> Config {
if let Ok(x) = env::var("DATABASE") {
config.database = x.trim().to_string();
}
if let Ok(x) = env::var("CSV") {
config.csv = x.trim().to_string();
}
if let Ok(x) = env::var("EMAIL_SMTP") {
config.mail_smtp = x.trim().to_string();