Skip to content

Commit

Permalink
Forward cargo package --list warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Aug 21, 2024
1 parent 87c915b commit ac72c31
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/source_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use ignore::overrides::Override;
use normpath::PathExt as _;
use path_slash::PathExt as _;
use std::collections::HashMap;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::process::Command;
use std::str;
Expand Down Expand Up @@ -153,8 +154,9 @@ fn add_crate_to_source_distribution(
skip_cargo_toml: bool,
) -> Result<()> {
let manifest_path = manifest_path.as_ref();
let args = ["package", "--list", "--allow-dirty", "--manifest-path"];
let output = Command::new("cargo")
.args(["package", "--list", "--allow-dirty", "--manifest-path"])
.args(args)
.arg(manifest_path)
.output()
.with_context(|| {
Expand All @@ -172,6 +174,10 @@ fn add_crate_to_source_distribution(
String::from_utf8_lossy(&output.stderr),
);
}
if !output.stderr.is_empty() {
eprintln!("From `cargo {}`:", args.join(" "));
std::io::stderr().write_all(&output.stderr)?;
}

let file_list: Vec<&Path> = str::from_utf8(&output.stdout)
.context("Cargo printed invalid utf-8 ಠ_ಠ")?
Expand Down

0 comments on commit ac72c31

Please sign in to comment.