Skip to content

Commit 8b1cb5c

Browse files
committed
ci: add detailed information for updating crates
1 parent 13b9024 commit 8b1cb5c

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

xtask/src/main.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,36 @@ async fn update_dependencies(
338338
verbose: bool,
339339
) -> Result<()> {
340340
println!("\n📦 Updating dependencies across all projects");
341+
342+
// Check if cargo-edit is installed
343+
let cargo_edit_check = TokioCommand::new("cargo")
344+
.arg("upgrade")
345+
.arg("--version")
346+
.stdout(Stdio::piped())
347+
.stderr(Stdio::piped())
348+
.output()
349+
.await;
350+
351+
if let Err(e) = cargo_edit_check {
352+
println!("❌ Failed to check for cargo-edit: {}", e);
353+
println!("\n⚠️ Required dependency missing: cargo-edit");
354+
println!("The 'cargo upgrade' command is provided by the cargo-edit crate.");
355+
println!("\n📥 Please install it with the following command:");
356+
println!(" cargo install cargo-edit");
357+
println!("\n💡 Then try running this command again.");
358+
return Ok(());
359+
} else if let Ok(output) = cargo_edit_check {
360+
if !output.status.success() {
361+
println!("❌ cargo-edit is not installed");
362+
println!("\n⚠️ Required dependency missing: cargo-edit");
363+
println!("The 'cargo upgrade' command is provided by the cargo-edit crate.");
364+
println!("\n📥 Please install it with the following command:");
365+
println!(" cargo install cargo-edit");
366+
println!("\n💡 Then try running this command again.");
367+
return Ok(());
368+
}
369+
}
370+
341371
if dry_run {
342372
println!("🔍 Running in DRY-RUN mode - no changes will be made");
343373
}

0 commit comments

Comments
 (0)