diff --git a/libimagrt/src/configuration.rs b/libimagrt/src/configuration.rs index c3cb9735..a2ee1fed 100644 --- a/libimagrt/src/configuration.rs +++ b/libimagrt/src/configuration.rs @@ -143,6 +143,7 @@ fn fetch_config(rtp: &PathBuf) -> Result { }; vec![ + vec![rtp.clone()], gen_vars(rtp.clone(), variants.clone(), &modifier), env::var("HOME").map(|home| gen_vars(PathBuf::from(home), variants.clone(), &modifier)) diff --git a/libimagrt/src/runtime.rs b/libimagrt/src/runtime.rs index e693feff..85567b1d 100644 --- a/libimagrt/src/runtime.rs +++ b/libimagrt/src/runtime.rs @@ -70,7 +70,14 @@ impl<'a> Runtime<'a> { spath }, PathBuf::from); - let cfg = match Configuration::new(&rtp) { + let configpath = matches.value_of("config") + .map_or_else(|| { + let mut spath = rtp.clone(); + spath.push("store"); + spath + }, PathBuf::from); + + let cfg = match Configuration::new(&configpath) { Err(e) => if e.err_type() != ConfigErrorKind::NoConfigFileFound { return Err(RuntimeErrorKind::Instantiate.into_error_with_cause(Box::new(e))); } else {