@@ -13,6 +13,7 @@ let _processes: child_process.ChildProcess[] = [];
1313
1414function _exec ( options : ExecOptions , cmd : string , args : string [ ] ) : Promise < string > {
1515 let stdout = '' ;
16+ let stderr = '' ;
1617 const cwd = process . cwd ( ) ;
1718 console . log ( white (
1819 ` ==========================================================================================`
@@ -42,9 +43,7 @@ function _exec(options: ExecOptions, cmd: string, args: string[]): Promise<strin
4243 . forEach ( line => console . log ( ' ' + line ) ) ;
4344 } ) ;
4445 npmProcess . stderr . on ( 'data' , ( data : Buffer ) => {
45- if ( options . silent ) {
46- return ;
47- }
46+ stderr += data . toString ( 'utf-8' ) ;
4847 data . toString ( 'utf-8' )
4948 . split ( / [ \n \r ] + / )
5049 . filter ( line => line !== '' )
@@ -62,7 +61,7 @@ function _exec(options: ExecOptions, cmd: string, args: string[]): Promise<strin
6261 if ( ! error ) {
6362 resolve ( stdout ) ;
6463 } else {
65- err . message += `${ error } ...` ;
64+ err . message += `${ error } ...\n\nSTDOUT:\n ${ stdout } \n ` ;
6665 reject ( err ) ;
6766 }
6867 } ) ;
@@ -96,12 +95,16 @@ export function silentExecAndWaitForOutputToMatch(cmd: string, args: string[], m
9695
9796export function ng ( ...args : string [ ] ) {
9897 if ( args [ 0 ] == 'build' ) {
99- return _exec ( { silent : true } , 'ng' , args ) ;
98+ return silentNg ( ... args ) ;
10099 } else {
101100 return _exec ( { } , 'ng' , args ) ;
102101 }
103102}
104103
104+ export function silentNg ( ...args : string [ ] ) {
105+ return _exec ( { silent : true } , 'ng' , args ) ;
106+ }
107+
105108export function silentNpm ( ...args : string [ ] ) {
106109 return _exec ( { silent : true } , 'npm' , args ) ;
107110}
0 commit comments