File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ import { execSync } from 'child_process';
1313import fs from 'fs' ;
1414import os from 'os' ;
1515import path from 'path' ;
16+ import tarFs from 'tar-fs' ;
1617import { fileURLToPath } from 'url' ;
18+ import { createGunzip } from 'zlib' ;
1719
1820const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
1921const repoRoot = path . resolve ( __dirname , '../../' ) ;
@@ -99,11 +101,15 @@ for (const [key, version] of Object.entries(versions)) {
99101 }
100102 const tarball = path . join ( tmpDir , tarballs [ 0 ] ) ;
101103
102- // Extract tarball
104+ // Extract tarball (pure Node.js — avoids system tar issues on Windows)
103105 const extractDir = path . join ( tmpDir , 'extracted' ) ;
104106 fs . mkdirSync ( extractDir ) ;
105- execSync ( `tar -xzf "${ tarball } " -C "${ extractDir } "` , {
106- stdio : 'pipe' ,
107+ await new Promise ( ( resolve , reject ) => {
108+ fs . createReadStream ( tarball )
109+ . pipe ( createGunzip ( ) )
110+ . pipe ( tarFs . extract ( extractDir ) )
111+ . on ( 'finish' , resolve )
112+ . on ( 'error' , reject ) ;
107113 } ) ;
108114
109115 // The tarball contains a "package/" directory
You can’t perform that action at this time.
0 commit comments