import Path from 'path' ; import { untar , GlobalTask , copy } from '../../lib' ; import { getNodeDownloadInfo } from './node_download_info' ; export const ExtractNodeBuilds = { global : true , description : 'Extracting node.js builds for all platforms' , async run ( config ) { await Promise . all ( config . getNodePlatforms ( ) . map ( async ( platform ) => { const { downloadPath , extractDir } = getNodeDownloadInfo ( config , platform ) ; if ( platform . isWindows ( ) ) { await copy ( downloadPath , Path . resolve ( extractDir , 'node.exe' ) , { clone : true , } ) ; } else { await untar ( downloadPath , extractDir , { strip : 1 } ) ; } } ) ) ; } , } ;