File tree 1 file changed +5
-7
lines changed
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ function generateTopic(args, file) {
19
19
} ) ;
20
20
} ) ;
21
21
}
22
- } ;
22
+ }
23
23
24
24
function assertExecOk ( r ) {
25
25
assert . isNull ( r . err ) ;
@@ -32,13 +32,11 @@ function assertExecNotOk(r) {
32
32
function parseResults ( stdout ) {
33
33
var results = stdout . split ( '\n' ) ;
34
34
35
-
36
- // win32 returns cmd. need to filter out
35
+ // win32 may console.log data which need to filter out invalid JSON at start of results
36
+ //TODO: do we need to filter out any console.log data as we are expecting only valid json
37
+ // any console.log used for dedugging may break parseResults
37
38
if ( process . platform === 'win32' ) {
38
-
39
- try {
40
- JSON . parse ( results [ 0 ] )
41
- } catch ( e ) {
39
+ while ( results . length > 0 && results [ 0 ] . charAt ( 0 ) !== '{' ) {
42
40
results . shift ( ) ;
43
41
}
44
42
}
You can’t perform that action at this time.
0 commit comments