Browse Source
Enable DATA_FOLDER to affect default CONFIG_FILE path
pull/473/head
Daniel García
6 years ago
No known key found for this signature in database
GPG Key ID: FC8A7D14C3CD543A
1 changed files with
4 additions and
1 deletions
-
src/config.rs
|
|
@ -9,7 +9,10 @@ lazy_static! { |
|
|
|
println!("Error loading config:\n\t{:?}\n", e); |
|
|
|
exit(12) |
|
|
|
}); |
|
|
|
pub static ref CONFIG_FILE: String = get_env("CONFIG_FILE").unwrap_or_else(|| "data/config.json".into()); |
|
|
|
pub static ref CONFIG_FILE: String = { |
|
|
|
let data_folder = get_env("DATA_FOLDER").unwrap_or_else(|| String::from("data")); |
|
|
|
get_env("CONFIG_FILE").unwrap_or_else(|| format!("{}/config.json", data_folder)) |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
pub type Pass = String; |
|
|
|