File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments