Fix: Pass the confguration path as parameter for Configuration::new()

If there is none, fall back to the RTP.
This commit is contained in:
Matthias Beyer 2016-05-28 23:04:10 +02:00
parent d50f8b3d0d
commit 180dfbf0b1

View file

@ -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 {