File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,31 @@ fn build_components(
8181fn build_component ( build_info : ComponentBuildInfo , app_dir : & Path ) -> Result < ( ) > {
8282 match build_info. build {
8383 Some ( b) => {
84- for command in b. commands ( ) {
85- terminal:: step!( "Building" , "component {} with `{}`" , build_info. id, command) ;
84+ let command_count = b. commands ( ) . len ( ) ;
85+
86+ if command_count > 1 {
87+ terminal:: step!(
88+ "Building" ,
89+ "component {} ({} commands)" ,
90+ build_info. id,
91+ command_count
92+ ) ;
93+ }
94+
95+ for ( index, command) in b. commands ( ) . enumerate ( ) {
96+ if command_count > 1 {
97+ terminal:: step!(
98+ "Running build step" ,
99+ "{}/{} for component {} with '{}'" ,
100+ index + 1 ,
101+ command_count,
102+ build_info. id,
103+ command
104+ ) ;
105+ } else {
106+ terminal:: step!( "Building" , "component {} with `{}`" , build_info. id, command) ;
107+ }
108+
86109 let workdir = construct_workdir ( app_dir, b. workdir . as_ref ( ) ) ?;
87110 if b. workdir . is_some ( ) {
88111 println ! ( "Working directory: {}" , quoted_path( & workdir) ) ;
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ pub struct ComponentBuildConfig {
9494
9595impl ComponentBuildConfig {
9696 /// The commands to execute for the build
97- pub fn commands ( & self ) -> impl Iterator < Item = & String > {
97+ pub fn commands ( & self ) -> impl ExactSizeIterator < Item = & String > {
9898 let as_vec = match & self . command {
9999 Commands :: Single ( cmd) => vec ! [ cmd] ,
100100 Commands :: Multiple ( cmds) => cmds. iter ( ) . collect ( ) ,
You can’t perform that action at this time.
0 commit comments