@@ -13,6 +13,7 @@ let _processes: child_process.ChildProcess[] = [];
13
13
14
14
function _exec ( options : ExecOptions , cmd : string , args : string [ ] ) : Promise < string > {
15
15
let stdout = '' ;
16
+ let stderr = '' ;
16
17
const cwd = process . cwd ( ) ;
17
18
console . log ( white (
18
19
` ==========================================================================================`
@@ -42,9 +43,7 @@ function _exec(options: ExecOptions, cmd: string, args: string[]): Promise<strin
42
43
. forEach ( line => console . log ( ' ' + line ) ) ;
43
44
} ) ;
44
45
npmProcess . stderr . on ( 'data' , ( data : Buffer ) => {
45
- if ( options . silent ) {
46
- return ;
47
- }
46
+ stderr += data . toString ( 'utf-8' ) ;
48
47
data . toString ( 'utf-8' )
49
48
. split ( / [ \n \r ] + / )
50
49
. filter ( line => line !== '' )
@@ -62,7 +61,7 @@ function _exec(options: ExecOptions, cmd: string, args: string[]): Promise<strin
62
61
if ( ! error ) {
63
62
resolve ( stdout ) ;
64
63
} else {
65
- err . message += `${ error } ...` ;
64
+ err . message += `${ error } ...\n\nSTDOUT:\n ${ stdout } \n ` ;
66
65
reject ( err ) ;
67
66
}
68
67
} ) ;
@@ -96,12 +95,16 @@ export function silentExecAndWaitForOutputToMatch(cmd: string, args: string[], m
96
95
97
96
export function ng ( ...args : string [ ] ) {
98
97
if ( args [ 0 ] == 'build' ) {
99
- return _exec ( { silent : true } , 'ng' , args ) ;
98
+ return silentNg ( ... args ) ;
100
99
} else {
101
100
return _exec ( { } , 'ng' , args ) ;
102
101
}
103
102
}
104
103
104
+ export function silentNg ( ...args : string [ ] ) {
105
+ return _exec ( { silent : true } , 'ng' , args ) ;
106
+ }
107
+
105
108
export function silentNpm ( ...args : string [ ] ) {
106
109
return _exec ( { silent : true } , 'npm' , args ) ;
107
110
}
0 commit comments