add consts file
This commit is contained in:
parent
77d427cbca
commit
02f1e0efd7
3 changed files with 5 additions and 1 deletions
1
src/config/consts.rs
Normal file
1
src/config/consts.rs
Normal file
|
@ -0,0 +1 @@
|
||||||
|
pub const CONFIG_FILE: &str = "mdp.yml";
|
|
@ -2,6 +2,7 @@ use serde_yaml;
|
||||||
|
|
||||||
pub mod read;
|
pub mod read;
|
||||||
pub mod validate;
|
pub mod validate;
|
||||||
|
pub mod consts;
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
|
|
|
@ -3,10 +3,12 @@ use std::path::PathBuf;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
|
|
||||||
|
use config::consts;
|
||||||
|
|
||||||
|
|
||||||
fn get_config_path() -> PathBuf {
|
fn get_config_path() -> PathBuf {
|
||||||
let mut working_dir = current_dir().unwrap();
|
let mut working_dir = current_dir().unwrap();
|
||||||
working_dir.push("mdp.yml");
|
working_dir.push(consts::CONFIG_FILE);
|
||||||
return working_dir;
|
return working_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue