File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11import { join , dirname } from "node:path" ;
22import { createWriteStream } from "node:fs" ;
33import { Readable } from "node:stream" ;
4+ import { pipeline } from "node:stream/promises" ;
45import { mkdir } from "node:fs/promises" ;
56import { matcher } from "matching-iterator" ;
67import {
@@ -401,10 +402,12 @@ export class Template extends LogLevelMixin(class {}) {
401402 async dump ( dest ) {
402403 for ( const entry of this . #entryCache. values ( ) ) {
403404 if ( entry . isBlob ) {
404- const d = join ( dest , entry . name ) ;
405- await mkdir ( dirname ( d ) , { recursive : true } ) ;
406- const readStream = await entry . readStream ;
407- Readable . fromWeb ( readStream ) . pipe ( createWriteStream ( d ) ) ;
405+ const destination = join ( dest , entry . name ) ;
406+ await mkdir ( dirname ( destination ) , { recursive : true } ) ;
407+ await pipeline (
408+ Readable . fromWeb ( await entry . stream ) ,
409+ createWriteStream ( destination )
410+ ) ;
408411 }
409412 }
410413 }
You can’t perform that action at this time.
0 commit comments