| 89 | } |
| 90 | |
| 91 | _done(): Observable<void> { |
| 92 | // Really commit everything to the actual filesystem. |
| 93 | return concatObservables( |
| 94 | observableFrom([...this._filesToDelete.values()]).pipe( |
| 95 | concatMap((path) => this._host.delete(path)), |
| 96 | ), |
| 97 | observableFrom([...this._filesToRename.entries()]).pipe( |
| 98 | concatMap(([_, [path, to]]) => this._host.rename(path, to)), |
| 99 | ), |
| 100 | observableFrom([...this._filesToCreate.entries()]).pipe( |
| 101 | concatMap(([path, buffer]) => this._host.write(path, buffer)), |
| 102 | ), |
| 103 | observableFrom([...this._filesToUpdate.entries()]).pipe( |
| 104 | concatMap(([path, buffer]) => this._host.write(path, buffer)), |
| 105 | ), |
| 106 | ).pipe(reduce(() => {})); |
| 107 | } |
| 108 | } |