import { downloadToDisk , GlobalTask } from '../../lib' ; import { getNodeShasums } from './node_shasums' ; import { getNodeDownloadInfo } from './node_download_info' ; export const DownloadNodeBuilds = { global : true , description : 'Downloading node.js builds for all platforms' , async run ( config , log ) { const shasums = await getNodeShasums ( log , config . getNodeVersion ( ) ) ; await Promise . all ( config . getNodePlatforms ( ) . map ( async ( platform ) => { const { url , downloadPath , downloadName } = getNodeDownloadInfo ( config , platform ) ; await downloadToDisk ( { log , url , shaChecksum : shasums [ downloadName ] , shaAlgorithm : 'sha256' , destination : downloadPath , maxAttempts : 3 , } ) ; } ) ) ; } , } ;