@@ -195,10 +195,12 @@ async function processSamples(command, paths) {
195
195
} )
196
196
197
197
await cluster . task ( async ( { page, data : sample } ) => {
198
- process . stdout . clearLine ( )
199
- process . stdout . cursorTo ( 0 )
200
- const percentComplete = Math . round ( ( 100 * numCompleted ) / samples . length )
201
- process . stdout . write ( `Processing samples: ${ percentComplete } %` )
198
+ if ( process . stdout . isTTY ) {
199
+ process . stdout . clearLine ( )
200
+ process . stdout . cursorTo ( 0 )
201
+ const percentComplete = Math . round ( ( 100 * numCompleted ) / samples . length )
202
+ process . stdout . write ( `Processing samples: ${ percentComplete } %` )
203
+ }
202
204
203
205
// BUG: some chart are animated - need special processing. Some just need to be skipped.
204
206
@@ -214,7 +216,9 @@ async function processSamples(command, paths) {
214
216
} )
215
217
}
216
218
numCompleted ++
217
- process . stdout . clearLine ( )
219
+ if ( ! process . stdout . isTTY ) {
220
+ console . log ( `Processed samples: ${ numCompleted } /${ samples . length } ` )
221
+ }
218
222
} )
219
223
220
224
for ( const sample of samples ) {
@@ -224,6 +228,12 @@ async function processSamples(command, paths) {
224
228
await cluster . idle ( )
225
229
await cluster . close ( )
226
230
231
+ if ( process . stdout . isTTY ) {
232
+ process . stdout . clearLine ( )
233
+ } else {
234
+ console . log ( 'All samples have now been processed' )
235
+ }
236
+
227
237
console . log ( '' )
228
238
229
239
if ( command === 'test' ) {
0 commit comments