summaryrefslogtreecommitdiffstats
path: root/src/commands/release.rs
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-04-21 15:32:33 +0200
committerMatthias Beyer <matthias.beyer@atos.net>2021-04-21 15:32:33 +0200
commit8f88a07ab48c1592f22db6aeedd5d3c920ea99e3 (patch)
treee1455c5e1382d9f56ca06cd6455f5f35af8fa1f6 /src/commands/release.rs
parent17aea85fb6a923313c62939c382445052b2f62dc (diff)
Add option to disable printing of released file pathes
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/commands/release.rs')
-rw-r--r--src/commands/release.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/commands/release.rs b/src/commands/release.rs
index 0bc59bb..0628d40 100644
--- a/src/commands/release.rs
+++ b/src/commands/release.rs
@@ -43,6 +43,7 @@ async fn new_release(
config: &Configuration,
matches: &ArgMatches,
) -> Result<()> {
+ let print_released_file_pathes = !matches.is_present("quiet");
let release_store_name = matches.value_of("release_store_name").unwrap(); // safe by clap
if !(config.releases_directory().exists() && config.releases_directory().is_dir()) {
return Err(anyhow!(
@@ -178,7 +179,11 @@ async fn new_release(
let rel = crate::db::models::Release::create(&conn, &art, &now, &release_store)?;
debug!("Release object = {:?}", rel);
- writeln!(std::io::stdout(), "{}", dest_path.display()).map_err(Error::from)
+ if print_released_file_pathes {
+ writeln!(std::io::stdout(), "{}", dest_path.display()).map_err(Error::from)
+ } else {
+ Ok(())
+ }
})
}