From 16c8d0a075ea374901f4d5b2a3a30a44855fb34d Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Thu, 20 Oct 2016 11:39:35 -0400 Subject: [PATCH] Create meta directory before running downloader This directory needs to exist to put the meta files into. Fixes https://github.com/pelias/whosonfirst/issues/146 --- download_data.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/download_data.js b/download_data.js index f9e9af04..90ee2809 100644 --- a/download_data.js +++ b/download_data.js @@ -1,10 +1,14 @@ var child_process = require('child_process'); var async = require('async'); +var fs = require('fs-extra'); var os = require('os'); var bundles = require('./src/bundleList'); var config = require('pelias-config').generate(); +//ensure required directory structure exists +fs.ensureDirSync(config.imports.whosonfirst.datapath + '/meta'); + // download one bundle for every other CPU (tar and bzip2 can both max out one core) // (but not more than 4, to keep things from getting too intense) // lower this number to make the downloader more CPU friendly