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(
81
81
fn build_component ( build_info : ComponentBuildInfo , app_dir : & Path ) -> Result < ( ) > {
82
82
match build_info. build {
83
83
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
+
86
109
let workdir = construct_workdir ( app_dir, b. workdir . as_ref ( ) ) ?;
87
110
if b. workdir . is_some ( ) {
88
111
println ! ( "Working directory: {}" , quoted_path( & workdir) ) ;
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ pub struct ComponentBuildConfig {
94
94
95
95
impl ComponentBuildConfig {
96
96
/// 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 > {
98
98
let as_vec = match & self . command {
99
99
Commands :: Single ( cmd) => vec ! [ cmd] ,
100
100
Commands :: Multiple ( cmds) => cmds. iter ( ) . collect ( ) ,
You can’t perform that action at this time.
0 commit comments