From 2befe3681e7e813e704fbbf75a520e04bf049d36 Mon Sep 17 00:00:00 2001 From: quininer kel Date: Fri, 6 Jan 2017 12:56:05 +0800 Subject: Write default config when not found --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 3328ab59..ce323ac1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,7 +38,11 @@ fn main() { match err { // Use default config when not found config::Error::NotFound => { - err_println!("Config file not found; using defaults"); + match Config::write_defaults() { + Ok(path) => err_println!("Config file not found; write defaults config to {:?}", path), + Err(err) => err_println!("Write defaults config failure: {}", err) + } + Config::default() }, -- cgit v1.2.3-54-g00ecf