@@ -39,7 +39,7 @@ public AngularCliBuilder(string npmScript)
39
39
}
40
40
41
41
/// <inheritdoc />
42
- public Task Build ( ISpaBuilder spaBuilder )
42
+ public async Task Build ( ISpaBuilder spaBuilder )
43
43
{
44
44
var sourcePath = spaBuilder . Options . SourcePath ;
45
45
if ( string . IsNullOrEmpty ( sourcePath ) )
@@ -57,18 +57,27 @@ public Task Build(ISpaBuilder spaBuilder)
57
57
null ) ;
58
58
npmScriptRunner . AttachToLogger ( logger ) ;
59
59
60
+ using ( var stdOutReader = new EventedStreamStringReader ( npmScriptRunner . StdOut ) )
60
61
using ( var stdErrReader = new EventedStreamStringReader ( npmScriptRunner . StdErr ) )
61
62
{
62
63
try
63
64
{
64
- return npmScriptRunner . StdOut . WaitForMatch (
65
- new Regex ( "chunk " , RegexOptions . None , RegexMatchTimeout ) ,
65
+ await npmScriptRunner . StdOut . WaitForMatch (
66
+ new Regex ( "Date " , RegexOptions . None , RegexMatchTimeout ) ,
66
67
BuildTimeout ) ;
67
68
}
68
69
catch ( EndOfStreamException ex )
69
70
{
70
71
throw new InvalidOperationException (
71
- $ "The NPM script '{ _npmScriptName } ' exited without indicating success. " +
72
+ $ "The NPM script '{ _npmScriptName } ' exited without indicating success.\n " +
73
+ $ "Output was: { stdOutReader . ReadAsString ( ) } \n " +
74
+ $ "Error output was: { stdErrReader . ReadAsString ( ) } ", ex ) ;
75
+ }
76
+ catch ( OperationCanceledException ex )
77
+ {
78
+ throw new InvalidOperationException (
79
+ $ "The NPM script '{ _npmScriptName } ' timed out without indicating success. " +
80
+ $ "Output was: { stdOutReader . ReadAsString ( ) } \n " +
72
81
$ "Error output was: { stdErrReader . ReadAsString ( ) } ", ex ) ;
73
82
}
74
83
}
0 commit comments