History

less verbose gh tool logging in dry-run mode (#198)

Sebastian Thiel committed 5 years ago

Commit 75ebf0b1 parent 552ae4f1 file · +14 −5Browse files

Unified · Split

cargo-smart-release/src/command/release/github.rs+14−5
@@ -38,18 +38,27 @@ pub fn create_release( · 37 unmodified lines
3838 let tag_name = crate::utils::tag_name(publishee, new_version, &ctx.repo);
3939 let mut cmd = Command::new("gh");
4040 cmd.arg(&tag_name)
41− .arg("--notes")
42− .arg(notes)
4341 .arg("--title")
44− .arg(format!("{} v{}", publishee.name, new_version));
42+ .arg(format!("{} v{}", publishee.name, new_version))
43+ .arg("--notes");
4544 if dry_run && verbose {
46− log::info!("{} run {:?}", will(dry_run), cmd);
45+ log::info!(
46+ "{} run {:?} \"{}…\" [note truncated]",
47+ will(dry_run),
48+ cmd,
49+ notes.chars().take(33).collect::<String>()
50+ );
4751 }
52+
53+ cmd.arg(notes);
4854 if !Program::named("gh").found {
4955 log::warn!("To create github releases, please install the 'gh' program and try again");
5056 return Ok(());
5157 } else if !dry_run && !cmd.status()?.success() {
52− log::warn!("'gh' tool execution failed - we will keep trying, and you may try to create the release manually using the command invocation above.");
58+ log::warn!(
59+ "'gh' tool execution failed - we will keep trying, and you may try to create the release with: {:?}",
60+ cmd
61+ );
5362 }
5463 Ok(())
5564 }