From 22745540d684db43fb5edc8fe67ea20bff385cae Mon Sep 17 00:00:00 2001 From: Tarun Mangukiya Date: Thu, 5 Mar 2020 14:52:12 +0530 Subject: [PATCH] fix: Ordering of icons --- scripts/line/download.js | 3 ++- scripts/monochrome/download.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/line/download.js b/scripts/line/download.js index 5e8cf300..adb028d4 100644 --- a/scripts/line/download.js +++ b/scripts/line/download.js @@ -4,6 +4,7 @@ const axios = require('axios') const eachLimit = require('async/eachLimit') const uniq = require('lodash/uniq') const filter = require('lodash/filter') +const sortBy = require('lodash/sortBy') const countDuplicates = require('../utils/countDuplicates') const downloadImage = require('../utils/downloadImage') @@ -88,7 +89,7 @@ const response = axios console.log(`${data.length} Images Downloaded!`) // Save the Airtable data as json - fs.writeFileSync(targetPath, JSON.stringify(data), 'utf-8') + fs.writeFileSync(targetPath, JSON.stringify(sortBy(data, 'name')), 'utf-8') // console.log(`New Data saved from Airtable to ${targetPath}!`) }) diff --git a/scripts/monochrome/download.js b/scripts/monochrome/download.js index 5b97318f..e0e70702 100644 --- a/scripts/monochrome/download.js +++ b/scripts/monochrome/download.js @@ -6,6 +6,8 @@ const targetImagePath = path.join(process.cwd(), 'svg/monochrome') const eachLimit = require('async/eachLimit') const uniq = require('lodash/uniq') const filter = require('lodash/filter') +const sortBy = require('lodash/sortBy') + const countDuplicates = require('../utils/countDuplicates') const downloadImage = require('../utils/downloadImage') const replaceFill = require('./replaceFill') @@ -89,7 +91,7 @@ const response = axios console.log(`${data.length} Images Downloaded!`) // Save the Airtable data as json - fs.writeFileSync(targetPath, JSON.stringify(data), 'utf-8') + fs.writeFileSync(targetPath, JSON.stringify(sortBy(data, 'name')), 'utf-8') // console.log(`New Data saved from Airtable to ${targetPath}!`) })