Skip to content

Commit c2f1998

Browse files
authored
Fix baseline accept when there are multiple .delete files (microsoft#30091)
1 parent 9787021 commit c2f1998

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/build/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ function rm(dest, opts) {
340340
duplex.push(file);
341341
cb();
342342
}
343-
duplex.push(null); // signal end of read queue
344343
};
345344

346345
const duplex = new Duplex({
@@ -374,15 +373,16 @@ function rm(dest, opts) {
374373
pending.push(entry);
375374
},
376375
final(cb) {
376+
const endThenCb = () => (duplex.push(null), cb()); // signal end of read queue
377377
processDeleted();
378378
if (pending.length) {
379379
Promise
380380
.all(pending.map(entry => entry.promise))
381381
.then(() => processDeleted())
382-
.then(() => cb(), cb);
382+
.then(() => endThenCb(), endThenCb);
383383
return;
384384
}
385-
cb();
385+
endThenCb();
386386
},
387387
read() {
388388
}

0 commit comments

Comments
 (0)