File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,26 @@ const ProgressBar = require('progress');
7
7
const chalk = require ( 'chalk' ) ;
8
8
9
9
function BuildProgressPlugin ( ) {
10
+ if ( process . env . CI ) {
11
+ return new ProgressPlugin ( function handler ( percentage , msg ) {
12
+ // noop
13
+ } )
14
+ }
10
15
const bar = new ProgressBar ( ` [:bar] ${ chalk . bold ( ':percent' ) } ${ chalk . yellow ( ':etas' ) } (${ chalk . dim ( ':msg' ) } )` , {
11
16
total : 100 ,
12
17
complete : '=' ,
13
18
incomplete : ' ' ,
14
19
width : 25
15
20
} ) ;
16
- return new ProgressPlugin ( function ( percent , msg ) {
17
- if ( percent === 1 ) msg = 'completed' ;
21
+ return new ProgressPlugin ( function handler ( percent , msg ) {
22
+ const done = percent === 1 ;
23
+ if ( done ) {
24
+ msg = 'completed' ;
25
+ }
18
26
bar . update ( percent , { msg } ) ;
19
- if ( percent === 1 ) bar . terminate ( ) ;
27
+ if ( done ) {
28
+ bar . terminate ( ) ;
29
+ }
20
30
} ) ;
21
31
}
22
32
You can’t perform that action at this time.
0 commit comments