diff --git a/app.js b/app.js index 005a9172..f2d833e3 100644 --- a/app.js +++ b/app.js @@ -1,11 +1,15 @@ const axios = require('axios'); + +const fs = require('fs'); +const createCsvWriter = require('csv-writer').createObjectCsvWriter; const csv = require('csv-parser'); const cmlog = require('cmlog'); const _ = require('lodash'); + const download = require('image-downloader'); + const config = require('./config.json'); -const fs = require('fs'); const folderPatch = process.cwd(); const cryptos = []; @@ -49,7 +53,7 @@ if (!_.isEmpty(config.apikey)) { `Retrieving the list of cryptos Total: [${cryptosData.length}]` ); - if (cryptosData.length === 0) { + if (cryptosData && cryptosData.length === 0) { cmlog.done('All icons have been updated !'); } else { cryptosData.forEach((crypto, index) => { @@ -84,8 +88,6 @@ if (!_.isEmpty(config.apikey)) { new Error(`Crypto icon not found => "${crypto}"`) ); - const createCsvWriter = require('csv-writer') - .createObjectCsvWriter; const csvWriter = createCsvWriter({ path: 'blacklist.csv', header: [{ id: 'name', title: 'NAME' }], diff --git a/blacklist.csv b/blacklist.csv index cf74a0ef..93f23b04 100644 --- a/blacklist.csv +++ b/blacklist.csv @@ -1,5 +1,4 @@ NAME -vec 2 xbtc 21 2 give nlc 2 @@ -115,3 +114,4 @@ lburst c 2 n 8 v lc 4 +vec 2