Skip to content

Commit

Permalink
Merge pull request #849 from epage/fix
Browse files Browse the repository at this point in the history
fix(publish): Filter out unpublished
  • Loading branch information
epage authored Dec 31, 2024
2 parents 20c3d0e + f70ad43 commit afaf3c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ops/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ pub fn publish(
registry: Option<&str>,
target: Option<&str>,
) -> CargoResult<bool> {
if pkgids.is_empty() {
return Ok(true);
}

let cargo = cargo();

let mut command: Vec<&str> = vec![
Expand Down Expand Up @@ -444,7 +448,7 @@ pub fn sort_workspace(ws_meta: &cargo_metadata::Metadata) -> Vec<&cargo_metadata
.iter()
.filter_map(|n| {
if members.contains(&n.id) {
// Ignore dev dependencies. This breaks dev dependency cyles and allows for
// Ignore dev dependencies. This breaks dev dependency cycles and allows for
// correct publishing order when a workspace package depends on the root package.

// It would be more correct to ignore only dev dependencies without a version
Expand Down
1 change: 1 addition & 0 deletions src/steps/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ fn workspace_publish(
// other cargo commands
let pkgids = pkgs
.iter()
.filter(|p| p.config.publish())
.map(|p| p.meta.name.as_str())
.collect::<Vec<_>>();
if !crate::ops::cargo::publish(
Expand Down

0 comments on commit afaf3c0

Please sign in to comment.