@@ -383,6 +383,7 @@ impl<'a> CargoCommand<'a> {
383
383
if let Some ( cargoarg) = cargoarg {
384
384
args. extend_from_slice ( & [ cargoarg] ) ;
385
385
}
386
+
386
387
args. extend_from_slice ( & [
387
388
self . command ( ) ,
388
389
"--example" ,
@@ -407,9 +408,15 @@ impl<'a> CargoCommand<'a> {
407
408
mode,
408
409
} => {
409
410
let mut args = vec ! [ "+nightly" ] ;
411
+
410
412
if let Some ( cargoarg) = cargoarg {
411
413
args. extend_from_slice ( & [ cargoarg] ) ;
412
414
}
415
+
416
+ // We need to be in the `rtic` directory to pick up
417
+ // the correct .cargo/config.toml file
418
+ args. extend_from_slice ( & [ "-Z" , "unstable-options" , "-C" , "rtic" ] ) ;
419
+
413
420
args. extend_from_slice ( & [
414
421
self . command ( ) ,
415
422
"--example" ,
@@ -641,6 +648,11 @@ impl<'a> CargoCommand<'a> {
641
648
if let Some ( cargoarg) = cargoarg {
642
649
args. extend_from_slice ( & [ cargoarg] ) ;
643
650
}
651
+
652
+ // We need to be in the `rtic` directory to pick up
653
+ // the correct .cargo/config.toml file
654
+ args. extend_from_slice ( & [ "-Z" , "unstable-options" , "-C" , "rtic" ] ) ;
655
+
644
656
args. extend_from_slice ( & [
645
657
self . command ( ) ,
646
658
"--example" ,
@@ -694,6 +706,13 @@ impl<'a> CargoCommand<'a> {
694
706
_ => None ,
695
707
}
696
708
}
709
+
710
+ pub fn print_stdout_intermediate ( & self ) -> bool {
711
+ match self {
712
+ Self :: ExampleSize { .. } => true ,
713
+ _ => false ,
714
+ }
715
+ }
697
716
}
698
717
699
718
impl BuildMode {
@@ -737,6 +756,10 @@ pub fn run_command(command: &CargoCommand, stderr_mode: OutputMode) -> anyhow::R
737
756
let stderr = String :: from_utf8 ( result. stderr ) . unwrap_or ( "Not displayable" . into ( ) ) ;
738
757
let stdout = String :: from_utf8 ( result. stdout ) . unwrap_or ( "Not displayable" . into ( ) ) ;
739
758
759
+ if command. print_stdout_intermediate ( ) && exit_status. success ( ) {
760
+ log:: info!( "\n {}" , stdout) ;
761
+ }
762
+
740
763
Ok ( RunResult {
741
764
exit_status,
742
765
stdout,
@@ -850,9 +873,8 @@ pub fn handle_results(globals: &Globals, results: Vec<FinalRunResult>) -> Result
850
873
. clone ( )
851
874
. for_each ( |( cmd, error) | error ! ( "❌ Failed: {cmd}\n {}\n {error}" , cmd. as_cmd_string( ) ) ) ;
852
875
853
- let ecount = errors. count ( ) ;
854
- let cecount = command_errors. count ( ) ;
855
- if ecount != 0 || cecount != 0 {
876
+ let ecount = errors. count ( ) + command_errors. count ( ) ;
877
+ if ecount != 0 {
856
878
log:: error!( "{ecount} commands failed." ) ;
857
879
Err ( ( ) )
858
880
} else {
0 commit comments