diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2022-10-09 20:08:36 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2022-10-09 20:08:36 +0300 |
commit | 46a038dc68093b28b69c3af38de4dd09431efae2 (patch) | |
tree | c7e01d04ffae1bd7118345bafd52de66c3e1ba13 | |
parent | 16646976d75284665c1fa0d7b7e3e3cde3531d66 (diff) | |
download | meli-46a038dc68093b28b69c3af38de4dd09431efae2.zip |
conf.rs: remove interactive messages when #[cfg(test)]
-rw-r--r-- | src/conf.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/conf.rs b/src/conf.rs index dcf88e46..fdd45562 100644 --- a/src/conf.rs +++ b/src/conf.rs @@ -345,18 +345,22 @@ impl FileSettings { if path_string.is_empty() { return Err(MeliError::new("No configuration found.")); } + #[cfg(not(test))] let ask = Ask { message: format!( "No configuration found. Would you like to generate one in {}?", path_string ), }; + #[cfg(not(test))] if ask.run() { create_config_file(&config_path)?; return Err(MeliError::new( "Edit the sample configuration and relaunch meli.", )); } + #[cfg(test)] + return Ok(FileSettings::default()); return Err(MeliError::new("No configuration file found.")); } |