@@ -78,12 +78,16 @@ export class CDKDeployer implements BackendDeployer {
7878 return ;
7979 }
8080 try {
81- await this . executeChildProcess ( 'npx' , [
82- 'tsc' ,
83- '--showConfig' ,
84- '--project' ,
85- dirname ( this . backendLocator . locate ( ) ) ,
86- ] ) ;
81+ await this . executeChildProcess (
82+ 'npx' ,
83+ [
84+ 'tsc' ,
85+ '--showConfig' ,
86+ '--project' ,
87+ dirname ( this . backendLocator . locate ( ) ) ,
88+ ] ,
89+ { printStdout : false }
90+ ) ;
8791 } catch ( error ) {
8892 // If we cannot load ts config, turn off type checking
8993 return ;
@@ -157,7 +161,11 @@ export class CDKDeployer implements BackendDeployer {
157161 * Wrapper for the child process executor. Helps in unit testing as node:test framework
158162 * doesn't have capabilities to mock exported functions like `execa` as of right now.
159163 */
160- executeChildProcess = async ( command : string , cdkCommandArgs : string [ ] ) => {
164+ executeChildProcess = async (
165+ command : string ,
166+ commandArgs : string [ ] ,
167+ options : { printStdout : boolean } = { printStdout : true }
168+ ) => {
161169 // We let the stdout and stdin inherit and streamed to parent process but pipe
162170 // the stderr and use it to throw on failure. This is to prevent actual
163171 // actionable errors being hidden among the stdout. Moreover execa errors are
@@ -169,7 +177,7 @@ export class CDKDeployer implements BackendDeployer {
169177 done ( ) ;
170178 } ;
171179
172- const childProcess = execa ( command , cdkCommandArgs , {
180+ const childProcess = execa ( command , commandArgs , {
173181 stdin : 'inherit' ,
174182 stdout : 'pipe' ,
175183 stderr : 'pipe' ,
@@ -180,7 +188,10 @@ export class CDKDeployer implements BackendDeployer {
180188 env : { FORCE_COLOR : '1' } ,
181189 } ) ;
182190 childProcess . stderr ?. pipe ( aggregatorStderrStream ) ;
183- childProcess . stdout ?. pipe ( process . stdout ) ;
191+
192+ if ( options ?. printStdout ) {
193+ childProcess . stdout ?. pipe ( process . stdout ) ;
194+ }
184195
185196 const cdkOutput = { deploymentTimes : { } } ;
186197 if ( childProcess . stdout ) {
0 commit comments