Skip to content

Commit

Permalink
Merge pull request #11 from pelias/fix-download-on-empty-config
Browse files Browse the repository at this point in the history
fix(download): avoid error with empty config
  • Loading branch information
orangejulius authored Jan 22, 2019
2 parents f428ff8 + eee8fcc commit e6cced6
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions utils/download_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,14 @@ const files = config.get('imports.csv.download');

if (!files) {
logger.warn('No files to download, quitting');
}

if (!targetDir) {
} else if (!targetDir) {
logger.warn('Datapath for saving files not configured, quitting');
}
} else {
logger.info(`Attempting to download selected data files: ${files}`);

logger.info(`Attempting to download selected data files: ${files}`);
fs.mkdirpSync(targetDir);


fs.mkdirpSync(targetDir);

async.eachLimit(files, 5, downloadStandard.bind(null, targetDir), function() {
logger.info('all done');
});
async.eachLimit(files, 5, downloadStandard.bind(null, targetDir), function() {
logger.info('all done');
});
}

0 comments on commit e6cced6

Please sign in to comment.