File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,8 +123,8 @@ export abstract class RMarkdownManager {
123123
124124 }
125125 const percentRegex = / [ 0 - 9 ] + (? = % ) / g;
126+ const divisionRegex = / ( [ 0 - 9 ] + ) \/ ( [ 0 - 9 ] + ) / g;
126127 const percentRegOutput = dat . match ( percentRegex ) ;
127-
128128 if ( percentRegOutput ) {
129129 for ( const item of percentRegOutput ) {
130130 const perc = Number ( item ) ;
@@ -136,7 +136,20 @@ export abstract class RMarkdownManager {
136136 ) ;
137137 currentProgress = perc ;
138138 }
139+ } else {
140+ const divisionRegOutput = divisionRegex . exec ( dat ) ;
141+ if ( divisionRegOutput ) {
142+ const perc = Math . ceil ( parseInt ( divisionRegOutput [ 1 ] ) / parseInt ( divisionRegOutput [ 2 ] ) * 100 ) ;
143+ progress ?. report (
144+ {
145+ increment : perc - currentProgress ,
146+ message : `${ perc } %`
147+ }
148+ ) ;
149+ currentProgress = perc ;
150+ }
139151 }
152+
140153 if ( token ?. isCancellationRequested ) {
141154 if ( childProcess ) {
142155 resolve ( childProcess ) ;
You can’t perform that action at this time.
0 commit comments