fix: better handle the csv data
This commit is contained in:
parent
55c042861f
commit
3cf298f137
3 changed files with 132 additions and 6 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue