Skip to content

Commit

Permalink
Fix cargo sdist --manifest-path for workspace project
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Mar 12, 2022
1 parent a34f76f commit dca7b27
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/source_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,15 @@ fn add_crate_to_source_distribution(
known_path_deps: &HashMap<String, PathDependency>,
root_crate: bool,
) -> Result<()> {
let crate_dir = manifest_path.as_ref().parent().with_context(|| {
format!(
"Can't get parent directory of {}",
manifest_path.as_ref().display()
)
})?;
let output = Command::new("cargo")
.args(&["package", "--list", "--allow-dirty", "--manifest-path"])
.arg(manifest_path.as_ref())
.args(&["package", "--list", "--allow-dirty"])
.current_dir(crate_dir)
.output()
.context("Failed to run cargo")?;
if !output.status.success() {
Expand Down

0 comments on commit dca7b27

Please sign in to comment.