[xtask] Fix cargo_run for publish command (#1611)

This commit is contained in:
Sylvain Benner 2024-04-12 14:14:30 -04:00 committed by GitHub
parent 09d4c709f4
commit b4ef118646
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 8 deletions

View File

@ -61,7 +61,7 @@ fn remote_version(crate_name: &str) -> Option<String> {
fn publish(crate_name: String) { fn publish(crate_name: String) {
// Perform dry-run to ensure everything is good for publishing // Perform dry-run to ensure everything is good for publishing
let dry_run_params = Params::from(["publish", "-p", &crate_name, "--dry-run"]); let dry_run_params = Params::from(["-p", &crate_name, "--dry-run"]);
run_cargo( run_cargo(
"publish", "publish",
@ -73,13 +73,7 @@ fn publish(crate_name: String) {
let crates_io_token = let crates_io_token =
env::var(CRATES_IO_API_TOKEN).expect("Failed to retrieve the crates.io API token"); env::var(CRATES_IO_API_TOKEN).expect("Failed to retrieve the crates.io API token");
let envs = HashMap::from([("CRATES_IO_API_TOKEN", crates_io_token.clone())]); let envs = HashMap::from([("CRATES_IO_API_TOKEN", crates_io_token.clone())]);
let publish_params = Params::from(vec![ let publish_params = Params::from(vec!["-p", &crate_name, "--token", &crates_io_token]);
"publish",
"-p",
&crate_name,
"--token",
&crates_io_token,
]);
// Actually publish the crate // Actually publish the crate
run_cargo( run_cargo(