From 325e17245c20b19e4884cc2ffd44774a3d4f4ae0 Mon Sep 17 00:00:00 2001 From: ppisljar Date: Wed, 7 Sep 2016 12:54:23 +0200 Subject: [PATCH] only skipping download if --skip-download cli argument is present --- tasks/build/download_node_builds.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tasks/build/download_node_builds.js b/tasks/build/download_node_builds.js index 09f1a1e7f099a..132d02acbcdc4 100644 --- a/tasks/build/download_node_builds.js +++ b/tasks/build/download_node_builds.js @@ -5,7 +5,9 @@ import { createGunzip } from 'zlib'; import { Extract } from 'tar'; import { fromFile } from 'check-hash'; import wreck from 'wreck'; +import { mkdirp } from 'mkdirp'; +const mkdirpAsync = promisify(mkdirp); const wreckGetAsync = promisify(wreck.get, wreck); const checkHashFromFileAsync = promisify(fromFile); const writeFileAsync = promisify(writeFile); @@ -80,10 +82,15 @@ export default function downloadNodeBuilds(grunt) { }; const start = async (platform) => { + const downloadDir = join(platform.nodeDir, '..'); let downloadCounter = 0; - let isDownloadValid = await checkShaSum(platform); + let isDownloadValid = false; - if (isDownloadValid) return; + await mkdirpAsync(downloadDir); + if (grunt.option('skip-download')) { + isDownloadValid = await checkShaSum(platform); + if (isDownloadValid) return; + } grunt.log.ok('starting download ...'); while (!isDownloadValid && (downloadCounter < downloadLimit)) {