@@ -2,7 +2,7 @@ import "#core/result";
22import childProcess from "node:child_process" ;
33import fs from "node:fs" ;
44import path from "node:path" ;
5- import { pipeline } from "node:stream" ;
5+ import { pipeline } from "node:stream/promises " ;
66import { fileURLToPath } from "node:url" ;
77import zlib from "node:zlib" ;
88import Ajv from "#core/ajv" ;
@@ -206,16 +206,13 @@ export default class DebianRepository {
206206 fs . writeFileSync ( this . root + `/dists/${ codename } /${ this . config . component } /binary-all/Packages` , res . data . stdout ) ;
207207
208208 // make "Packages.gz"
209- await new Promise ( resolve => {
210- pipeline (
211- fs . createReadStream ( this . root + `/dists/${ codename } /${ this . config . component } /binary-all/Packages` ) ,
212- zlib . createGzip ( {
213- "level" : 9 ,
214- } ) ,
215- fs . createWriteStream ( this . root + `/dists/${ codename } /${ this . config . component } /binary-all/Packages.gz` ) ,
216- e => { }
217- ) . on ( "close" , resolve ) ;
218- } ) ;
209+ await pipeline (
210+ fs . createReadStream ( this . root + `/dists/${ codename } /${ this . config . component } /binary-all/Packages` ) ,
211+ zlib . createGzip ( {
212+ "level" : 9 ,
213+ } ) ,
214+ fs . createWriteStream ( this . root + `/dists/${ codename } /${ this . config . component } /binary-all/Packages.gz` )
215+ ) ;
219216
220217 const architectures = (
221218 await glob ( "binary-*" , {
@@ -247,16 +244,13 @@ export default class DebianRepository {
247244 fs . writeFileSync ( this . root + `/dists/${ codename } /${ this . config . component } /binary-${ architecture } /Packages` , res . data . stdout ) ;
248245
249246 // make "Packages.gz"
250- await new Promise ( resolve => {
251- pipeline (
252- fs . createReadStream ( this . root + `/dists/${ codename } /${ this . config . component } /binary-${ architecture } /Packages` ) ,
253- zlib . createGzip ( {
254- "level" : 9 ,
255- } ) ,
256- fs . createWriteStream ( this . root + `/dists/${ codename } /${ this . config . component } /binary-${ architecture } /Packages.gz` ) ,
257- e => { }
258- ) . on ( "close" , resolve ) ;
259- } ) ;
247+ await pipeline (
248+ fs . createReadStream ( this . root + `/dists/${ codename } /${ this . config . component } /binary-${ architecture } /Packages` ) ,
249+ zlib . createGzip ( {
250+ "level" : 9 ,
251+ } ) ,
252+ fs . createWriteStream ( this . root + `/dists/${ codename } /${ this . config . component } /binary-${ architecture } /Packages.gz` )
253+ ) ;
260254 }
261255
262256 fs . writeFileSync (
0 commit comments