Create store path on storage backend creation

This commit is contained in:
Matthias Beyer 2015-12-01 17:31:41 +01:00
parent abee4d4904
commit 731d13e0ba
2 changed files with 8 additions and 2 deletions

View file

@ -25,6 +25,8 @@ mod module;
mod storage;
mod ui;
use std::process::exit;
fn main() {
let yaml = load_yaml!("../etc/cli.yml");
let app = App::from_yaml(yaml);
@ -41,14 +43,17 @@ fn main() {
debug!("Runtime : {:?}", &rt);
let backend = StorageBackend::new(&rt).unwrap_or_else(|e| {
error!("Error: {}", e);
exit(1);
});
if let Some(matches) = rt.config.cli_matches.subcommand_matches("bm") {
let module = BMModule::new(&rt);
let commands = module.get_commands(&rt);
if let Some(command) = matches.subcommand_name() {
debug!("Subcommand: {}", command);
let backend = StorageBackend::new(&rt);
let cmdenv = CommandEnv {
rt: &rt,
bk: &backend,

View file

@ -6,6 +6,7 @@ use std::path::Path;
use std::path::PathBuf;
use std::vec::Vec;
use std::fs::File as FSFile;
use std::fs::create_dir_all;
use std::fs::remove_file;
use std::io::Read;
use std::io::Write;