From 25ade0806b5ef92765d8c5f0116501f9d44e3a13 Mon Sep 17 00:00:00 2001 From: Jonathan Strong Date: Thu, 16 Nov 2023 03:00:43 -0500 Subject: [PATCH] fix it so when you run in --dry-mode, it doesn't start publishing crates (!) --- src/publish.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/publish.rs b/src/publish.rs index 3a6ef0c..f84990d 100644 --- a/src/publish.rs +++ b/src/publish.rs @@ -728,6 +728,16 @@ fn cargo_publish_modified_source_dir(config: &Config, meta: &VersionMeta) -> Res args.extend_from_slice(&["--manifest-path", manifest_path_str.as_str()][..]); args.extend_from_slice(&["--no-verify", "--allow-dirty", "-vv"][..]); + if config.dry_run { + warn!( + name = %meta.index_meta.name, + vers = %meta.index_meta.vers, + cmd = format!("cargo {}", args.join(" ")), + "skipping actual publish cmd: --dry-run mode", + ); + return Ok(()) + } + debug!(name = %meta.index_meta.name, vers = %meta.index_meta.vers, "executing `cargo {}`", args.join(" ")); let output = std::process::Command::new("cargo") .env(&index_env_key, &config.dst.index_url)