@@ -81,39 +81,36 @@ fn build_components(
8181fn build_component ( build_info : ComponentBuildInfo , app_dir : & Path ) -> Result < ( ) > {
8282 match build_info. build {
8383 Some ( b) => {
84- terminal:: step!(
85- "Building" ,
86- "component {} with `{}`" ,
87- build_info. id,
88- b. command
89- ) ;
90- let workdir = construct_workdir ( app_dir, b. workdir . as_ref ( ) ) ?;
91- if b. workdir . is_some ( ) {
92- println ! ( "Working directory: {}" , quoted_path( & workdir) ) ;
93- }
94-
95- let exit_status = Exec :: shell ( & b. command )
96- . cwd ( workdir)
97- . stdout ( Redirection :: None )
98- . stderr ( Redirection :: None )
99- . stdin ( Redirection :: None )
100- . popen ( )
101- . map_err ( |err| {
102- anyhow ! (
103- "Cannot spawn build process '{:?}' for component {}: {}" ,
104- & b. command,
84+ for command in b. commands ( ) {
85+ terminal:: step!( "Building" , "component {} with `{}`" , build_info. id, command) ;
86+ let workdir = construct_workdir ( app_dir, b. workdir . as_ref ( ) ) ?;
87+ if b. workdir . is_some ( ) {
88+ println ! ( "Working directory: {}" , quoted_path( & workdir) ) ;
89+ }
90+
91+ let exit_status = Exec :: shell ( command)
92+ . cwd ( workdir)
93+ . stdout ( Redirection :: None )
94+ . stderr ( Redirection :: None )
95+ . stdin ( Redirection :: None )
96+ . popen ( )
97+ . map_err ( |err| {
98+ anyhow ! (
99+ "Cannot spawn build process '{:?}' for component {}: {}" ,
100+ & b. command,
101+ build_info. id,
102+ err
103+ )
104+ } ) ?
105+ . wait ( ) ?;
106+
107+ if !exit_status. success ( ) {
108+ bail ! (
109+ "Build command for component {} failed with status {:?}" ,
105110 build_info. id,
106- err
107- )
108- } ) ?
109- . wait ( ) ?;
110-
111- if !exit_status. success ( ) {
112- bail ! (
113- "Build command for component {} failed with status {:?}" ,
114- build_info. id,
115- exit_status,
116- ) ;
111+ exit_status,
112+ ) ;
113+ }
117114 }
118115
119116 Ok ( ( ) )
0 commit comments