@@ -3,6 +3,7 @@ import { execSync } from 'child_process';
33import * as fs from 'fs' ;
44import * as path from 'path' ;
55import * as os from 'os' ;
6+ import AdmZip from 'adm-zip' ;
67
78// Get absolute path to rememory binary
89export function getRememoryBin ( ) : string {
@@ -34,11 +35,18 @@ export function createTestProject(): string {
3435}
3536
3637// Extract a bundle ZIP and return the extracted directory path
38+ // Note: friendName is case-insensitive, bundle files are lowercase
3739export function extractBundle ( bundlesDir : string , friendName : string ) : string {
38- const bundleZip = path . join ( bundlesDir , `bundle-${ friendName } .zip` ) ;
39- const extractDir = path . join ( bundlesDir , `bundle-${ friendName } ` ) ;
40+ const lowerName = friendName . toLowerCase ( ) ;
41+ const bundleZip = path . join ( bundlesDir , `bundle-${ lowerName } .zip` ) ;
42+ const extractDir = path . join ( bundlesDir , `bundle-${ lowerName } ` ) ;
43+
4044 fs . mkdirSync ( extractDir , { recursive : true } ) ;
41- execSync ( `unzip -o "${ bundleZip } " -d "${ extractDir } "` , { stdio : 'ignore' } ) ;
45+
46+ // Use adm-zip for cross-platform extraction
47+ const zip = new AdmZip ( bundleZip ) ;
48+ zip . extractAllTo ( extractDir , true ) ;
49+
4250 return extractDir ;
4351}
4452
0 commit comments