@@ -13,7 +13,8 @@ interface OperationState {
1313 newVersion : string ;
1414 commitMessage : string ;
1515 tagName : string ;
16- files : string [ ] ;
16+ updatedFiles : string [ ] ;
17+ skippedFiles : string [ ] ;
1718}
1819
1920interface UpdateOperationState extends Partial < OperationState > {
@@ -39,7 +40,8 @@ export class Operation {
3940 newVersion : "" ,
4041 commitMessage : "" ,
4142 tagName : "" ,
42- files : [ ] ,
43+ updatedFiles : [ ] ,
44+ skippedFiles : [ ] ,
4345 } ;
4446
4547 /**
@@ -55,7 +57,8 @@ export class Operation {
5557 newVersion : state . newVersion ,
5658 commit : options . commit ? state . commitMessage : false ,
5759 tag : options . tag ? state . tagName : false ,
58- files : state . files . slice ( ) ,
60+ updatedFiles : state . updatedFiles . slice ( ) ,
61+ skippedFiles : state . skippedFiles . slice ( ) ,
5962 } ;
6063 }
6164
@@ -86,21 +89,13 @@ export class Operation {
8689 /**
8790 * Updates the operation state and results, and reports the updated progress to the user.
8891 */
89- public update ( state : UpdateOperationState ) : this {
90- if ( state . files ) {
91- // Concatenate the two `files` arrays, rather than overwriting
92- state . files = this . state . files . concat ( state . files ) ;
93- }
94-
92+ public update ( { event, ...newState } : UpdateOperationState ) : this {
9593 // Update the operation state
96- Object . assign ( this . state , state ) ;
94+ Object . assign ( this . state , newState ) ;
9795
98- if ( state . event && this . _progress ) {
96+ if ( event && this . _progress ) {
9997 // Report the progress to the user
100- this . _progress ( {
101- event : state . event ,
102- ...this . results
103- } ) ;
98+ this . _progress ( { event, ...this . results } ) ;
10499 }
105100
106101 return this ;
0 commit comments