Skip to content

Commit

Permalink
only skipping download if --skip-download cli argument is present
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Oct 29, 2016
1 parent 955972b commit 325e172
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tasks/build/download_node_builds.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 325e172

Please sign in to comment.