import spawnAsync from '@expo/spawn-async' ; import tar from 'tar' ; export async function extractAsync ( archive , dir ) { try { if ( process . platform !== 'win32' ) { await spawnAsync ( 'tar' , [ '-xf' , archive , '-C' , dir ] , { stdio : 'inherit' , cwd : __dirname } ) ; return ; } } catch ( e ) { console . error ( e . message ) ; } await tar . extract ( { file : archive , cwd : dir } ) ; }