File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -123,8 +123,8 @@ export abstract class RMarkdownManager {
123
123
124
124
}
125
125
const percentRegex = / [ 0 - 9 ] + (? = % ) / g;
126
+ const divisionRegex = / ( [ 0 - 9 ] + ) \/ ( [ 0 - 9 ] + ) / g;
126
127
const percentRegOutput = dat . match ( percentRegex ) ;
127
-
128
128
if ( percentRegOutput ) {
129
129
for ( const item of percentRegOutput ) {
130
130
const perc = Number ( item ) ;
@@ -136,7 +136,20 @@ export abstract class RMarkdownManager {
136
136
) ;
137
137
currentProgress = perc ;
138
138
}
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
+ }
139
151
}
152
+
140
153
if ( token ?. isCancellationRequested ) {
141
154
if ( childProcess ) {
142
155
resolve ( childProcess ) ;
You can’t perform that action at this time.
0 commit comments