Fix: Pass the confguration path as parameter for Configuration::new()
If there is none, fall back to the RTP.
This commit is contained in:
parent
d50f8b3d0d
commit
180dfbf0b1
1 changed files with 8 additions and 1 deletions
|
@ -70,7 +70,14 @@ impl<'a> Runtime<'a> {
|
||||||
spath
|
spath
|
||||||
}, PathBuf::from);
|
}, 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 {
|
Err(e) => if e.err_type() != ConfigErrorKind::NoConfigFileFound {
|
||||||
return Err(RuntimeErrorKind::Instantiate.into_error_with_cause(Box::new(e)));
|
return Err(RuntimeErrorKind::Instantiate.into_error_with_cause(Box::new(e)));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue