summaryrefslogtreecommitdiffstats
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
parent17aea85fb6a923313c62939c382445052b2f62dc (diff)
Add option to disable printing of released file pathes
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
-rw-r--r--src/cli.rs7
-rw-r--r--src/commands/release.rs7
2 files changed, 13 insertions, 1 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 0c0e78d..6e69361 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -820,6 +820,13 @@ pub fn cli<'a>() -> App<'a> {
.about("Dont be interactive (only with --update at the moment)")
.requires("package_do_update")
)
+ .arg(Arg::new("quiet")
+ .required(false)
+ .multiple(false)
+ .long("quiet")
+ .short('q')
+ .about("Don't print pathes to released filesfiles after releases are complete")
+ )
)
)
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(())
+ }
})
}