add consts file

This commit is contained in:
Jake Howard 2017-07-17 09:59:54 +01:00
parent 77d427cbca
commit 02f1e0efd7
Signed by: jake
GPG key ID: 57AFB45680EDD477
3 changed files with 5 additions and 1 deletions

1
src/config/consts.rs Normal file
View file

@ -0,0 +1 @@
pub const CONFIG_FILE: &str = "mdp.yml";

View file

@ -2,6 +2,7 @@ use serde_yaml;
pub mod read;
pub mod validate;
pub mod consts;
#[derive(Debug, Serialize, Deserialize)]
pub struct Config {

View file

@ -3,10 +3,12 @@ use std::path::PathBuf;
use std::fs::File;
use std::io::Read;
use config::consts;
fn get_config_path() -> PathBuf {
let mut working_dir = current_dir().unwrap();
working_dir.push("mdp.yml");
working_dir.push(consts::CONFIG_FILE);
return working_dir;
}