summaryrefslogtreecommitdiffstats
path: root/libimagrt
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-05-28 23:04:10 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-05-28 23:11:10 +0200
commit180dfbf0b13a6286d7d9e0c348bb52d6633f4fd2 (patch)
treee73918eba24fef9b1d4d00e225ea5a2a2516061d /libimagrt
parentd50f8b3d0d94df174229c7c0e00753d57fcb9707 (diff)
Fix: Pass the confguration path as parameter for Configuration::new()
If there is none, fall back to the RTP.
Diffstat (limited to 'libimagrt')
-rw-r--r--libimagrt/src/runtime.rs9
1 files changed, 8 insertions, 1 deletions
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 {